shell: telnet: Make sure the delayed work becomes idle after canceling

Replace k_work_cancel_delayable() with k_work_cancel_delayable_sync()
to make sure that the submitted work becomes idle before accessing
sensitive data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2 files changed