test_unix_connection now detects the socket directory.

Change pg_hba.conf to allow connections through the socket.

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