Save the locked handle in obtainWriteLock
Merge pull request #1943 from owncloud/lock-save-write-lock

Save the locked handle in obtainWriteLock