Add smtpconnect tool to exercise connection code

tlsconnect is useless for testing things since it doesn't use any of
the real code.
Fix SSL timeouts

Add break on timeval == 0
Fix inbound SSL timeout

Add missing extern, use correct variables.
Fix wait min/max setting
Cosmetic: correct debug output for UNEXPANDED_TIME
Add an option to randomise message delivery order
Add per-connection message limit