Failing to set SO_LINGER is not a catastrophic event, do not exit.
Do not log at level ERR non-catastrophic events.
The caller exits, no need to do it in the callee.
No change in logic, just moved things around to make more functions static.