Maintain legacy RTOS behavior before mbed-5

Fork of mbed-rtos by mbed official

unknown revision '940e6df82a6b'