QueryManager: fix bug in finishQuery

See @jingjingwang's comment here:

https://github.com/uwescience/myria/commit/ddc32c5aeecaae46c656ad45a2524feec7079e0e#commitcomment-8924789
Merge pull request #655 from uwescience/fix-finish-query-bug

QueryManager: fix bug in finishQuery