Moved lock validation up to LockingRepository

Added tests for lock validation to ES and simple repositories