Fix flaky libcore.java.net.FtpURLConnectionTest#testCountingProxy

The test was closing the socket, potentially aborting the pending
connection, potentially before the server thread got around to
counting it. Calling proxy.shutdownAndGetConnectionCount() before
closing the client socket ensures that the (single) request is
counted.

Test: Ran FtpURLConnectionTest ten times

Change-Id: Id1c2d9be9571a5c1baece5a1cf16bfc215eee9c9
1 file changed