Put socket subtests on distinct port numbers

The two test_echo_gai cases occasionally interact to cause a connection
attempt to fail with ECONNRESET.  It seems that, even though the server
socket from one test_echo_gai has been closed by the time the next
test_echo_gai case is called, the old server socket has some lingering
influence (removing one test case or the other makes the problem go away;
I can only reproduce it with the two test case adjacent).  Putting
the two test cases on distinct port numbers avoids the problem.
Do apply_updates before stopping polling

If we don't process updated, there can be pollfd entries hanging around,
causing the assert near the end of poll_thread to trigger.