Improved mutex queue

By now MutexedQueue does waiting for elements to fill by sleeping 10 seconds, look for element, look for timeout, sleep again.

I replaced this by using timed semaphore calls. This should improve performance too.

I added some comments to unsafe(from threading point of view) queue processing locations too.