Prevent double query submission to fix COUCHDB-2378