Add sending a signal

This change allows my app to not crash when writing response coming from a separate thread but the client has already closed the connection.