Unmonitor query-gateway on shutdown