COCAINE-102 - Thread-safe session queue.

Maybe it gives some code cleanup.