ISPN-4291 Poor REPL state transfer performance with cache stores

https://issues.jboss.org/browse/ISPN-4400

* Skip the cache store iteration if the local node didn't lose any segments
* Move the invalidation after receiving the transaction data, so that write
  commands can be performed in parallel.
Besides, even if I do add a separate filter, I still have to compute the segment again in order to decide in which collection to add it. So separating the filter would actually slow things down.