Scheduler updates

Added semaphore take (osSemaphoreWait) functionality, and respective
scheduler support.