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.