Set the query and resume threads to the just-stopped thread.

Resolves #931.

Almost trivial fix, but it takes forever to work with the FF test suites :/.