Don't respond with 500 when sockets close/time out

Possible fix for issue #261