ISPN-3354 Multiple events on the local node with Infinispan 5.3.0-final

Also, I fixed a bug taht could cause inconsistent data in replicated
mode and added tests for that.

https://issues.jboss.org/browse/ISPN-3354

Edit:

Fixed problem with query. After all, it was a state transfer problem. this is the corresponding JIRA:

https://issues.jboss.org/browse/ISPN-3722