Fix semaphore segfault when tryWait'ing on invalid semaphore.
Fix semaphore segfault when tryWait'ing on invalid semaphore.

DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver,DDVTECH/mistserver