Fix a bug in sys_mbox_fetch.

The sempahore associated with the message queue would be incremented
even if no message was received because of a timeout, which could create
cases where the semaphore's count is higher than the number of available
slots in the queue.