JCR-5229: LockedWrapperTest.testSequenceWithSessionRefresh() may fail due to race conditions (#338) Added synchronization.