Implement connect timeout.

The tests for this depend on a firewall block rule.