Maintain legacy RTOS behavior before mbed-5

Fork of mbed-rtos by mbed official

unknown revision '7df7e92ddbb9'