kernel: rt_thread_sleep should only be called in thread context

Add a DEBUG guard for it.