ISPN-5104 Infinite loop in TransactionAwareCloseableIterator when
iterating through cache

Fixed issue where entry was repeated if added to context after
starting a transaction
Test that replaying a prepare command doesn't acquire the lock twice