Replace cancel_send_timeout with generalized cancel_timeout.
Add idle timeout to close drain sockets when no messages flow for a while.
Five minutes is actually 300000 ms.
Incorporate feedback from comments.
Add tcp_states.dot file visualizing logplex_tcpsyslog_drain gen_fsm.
Add disconnecting state for when we hit the idle timeout in the sending state.

The disconnecting state is similar to sending, but unless a post is
received it will end up in the disconnected state. I've collapsed the
two inet_reply clauses into a single one that only logs when there's
an error.
Remove problematic IDLE_TIMEOUT macro, fix a few typos.
Add test for tcp drain closing.

Test is currently failing even though according to the logs the socket
is being closed at the right spot.
Re-cache OS env-vars in TCP drain tests.

Otherwise we get stuck with the default idle timeout.
Test against drain's internal state rather than checking for closed socket.

For some extremely mysterious reason, closing one side of this socket
refuses to close the other in the tests, though manual tests with
netcat confirm that it's in fact being closed.
We already have the drain pid in this test; don't need to look it up.
Add disconnecting to tcpsyslog_drain pstate.
Add tcp_syslog_idle_timeout to logplex.app.src, unify config name.
Attempt to read from idled socket in test.

This is better than checking the process state, which was the
workaround we were using for the fact that port_info refused to
consider the socket closed.
Tidy up a few style issues.
Have a single timer for TCP drains that checks last_good_time.

As per Fred's suggestion, this is a lot simpler than resetting the
timer every time you buffer a new message since it doesn't require
re-cancelling timers over and over in a non-idle buffer.
Add fuzzing to idle timeouts to avoid thundering herd.
Fix a few typos, add a few TODOs.
Preserve millisecond granularity in close_if_idle.
Clarify we aren't using these args.