Small improvements to error-handling

Check the return value of calls to timer_delete(), timer_settime(),
timer_getoverrun(), and sem_wait().

Change-Id: Icfd6016c7be268c60f1101785b690b3785e7e616
Merge "Small improvements to error-handling"