Port [fix](https://github.com/marklogic/java-client-api/commit/d852f3bda86f99f5a4f8f3e3f4700e3b32c1bc8b) for #423 to 3.x branch