kernel: add rt_critical_level that return the lock count of scheduler

Out side world may be interested in whether the scheduler is locked or
not. Provide an API to tell that.
kernel: let rt_thread_idle_excute loop until there is no dead thread

Out side world is difficult to tell whethere there is dead thread
remaining. If rt_thread_idle_excute only do one cleanup, it's hard to
finish cleanups outside the idle thread. So let is loop and do all the
cleanups in one call.
Merge pull request #214 from grissiom/rtt-next2

Rtt next2