Prevent 'query' event from being emitted if there's no query object.

It may be possible for the ```query``` object to be ```undefined``` due to ```Query.parse()``` throwing an exception via ```protocol.decode()``` in ```server.js```.