tests: Add test that getsockname is correct after socket().