do not let client input to exit the server side

No matter how broken, wrong, or malicious, client side behavior is the
server side should not react on such by exiting.  That will simply lead
to dos'ing being possible, and there is no need for that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
avoid unnecessary strlen() call

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
ensure receive buffer has null at the end of the string

Signed-off-by: Sami Kerola <kerolasa@iki.fi>