Move disconnect() and fail() calls into respond callback to prevent race when client is pipelining