[Bug Fix] Fixed race condition in slave session.

Message queue is thread-unsafe by design: uncontrolled access to it from multiple threads results in undefined behavior. All chunks are guaranteed to be pushed from engine's thread, but `invoke` event is sent from session creator thread which differs from the previous one. Sometimes `chunk` event was followed by `invoke` event, which is bug.

Now message queue is synchronized explicitly.
Merge pull request #136 from 3Hren/master

[Bug Fix] Fixed race condition in slave session.