QueryManager: fix bug in finishQuery

See @jingjingwang's comment here:

https://github.com/uwescience/myria/commit/ddc32c5aeecaae46c656ad45a2524feec7079e0e#commitcomment-8924789