Fixed shared_mux timeout bug

Fixed bug introduced in previous commit of this branch whereby the timeout
detection in the multiplexer thread was extended to detect multiple timeouts, if
available. The bug is that the Timeout Queue Mutex was not relocked upon
successive iterations of the loop, which leads to a race condition.

This commit fixes the bug by relocking the mutex.