Fix bug in testing preconditions and events
Fix bug in testing preconditions and events

The bug occurs when the session was serialized and deserialized as a
result of requests coming through a new TCP connection.

Resolves: #219

akcoder/genieacs,zaidka/genieacs