explicitly flush all gzip data

On pypy data is buffered to long due to different garbage collection
strategies [0]. By explicitly closing the dummy files those buffers are
flushed and data is not truncated.

[0] (http://doc.pypy.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies
explicitly close listening and connected sockets
Merge pull request #147 from t-8ch/fix_pypy_tests

Fix pypy tests.