Prevent hang of LOCK in xquery update code of SOAP interface

Found and fixed by Russell http://markmail.org/message/pau6hoaeybg2bvch