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.
don't need to be anonymous. I think this filter can be useful in other places and in the future. Also, it may not be good for ```DataContainer```, but it will be good for ```CacheStores``` (like ```SingleFileStore``` that iterates over the keys in memory and then it tries to load each key lazily)