test_unix_connection now detects the socket directory.

Also, per comments on PR #35:
- Inline open_unix
- Centralize common code from connect and connect_unix in connect_finish.