Reduce usage of files and threads in regrtest

Some of the tests, such as test_socket or test_xmlrpc, seem to
implicitly rely on deterministic destruction, given that using
gc.collect() will close out sockets and corresponding thread
pools. test_tarfile checks sys.platform for how many files to open,
but was not aware of running on sys.platform.startswith('java').

Lastly we have a resource leak on closing out the last thread in
thread pools for server sockets, and this causes issues with general
thread allocation after enough server sockets are opened. Need to
revisit with respect to Netty 4.1 which supports a better thread pool
and scheduling scheme via Fork Join. This probably is only seen in
testing however.