Prevent NPE when dispatching response to closed connection

Fixes the NPE that is thrown when a request completes after a timeout has occurred and the connection has been closed. See #387

Before using the actorContext, it is checked that it has not become null.