Avoid unnecessary socket exceptions

When body is empty, do not issue a second gen_tcp:send() because the client may have already closed the socket