dup the query so the existing query is not modified

Fixes https://github.com/mongoid/mongoid/issues/2978