[FIX] XQuery, doc(): ignore exception thrown by close(). Closes #741