Maintain legacy RTOS behavior before mbed-5

Fork of mbed-rtos by mbed official

unknown revision '9dd0e1f7c2bf'