Fix intermittent failures when testing copy_database.

If in the midst of a test, an IOStream from a previous test is garbage-collected, it
can cause spurious errors. Tornado logs, "Write error on 15: [Errno 9] Bad file
descriptor". Tornado 4.0 fixes this here:

https://github.com/tornadoweb/tornado/commit/7552caed9966b01d01786229ccc2cc9049e8068d

But to keep tests passing in Tornado 3, we must close each client explicitly and
call gc.collect() to ensure all IOStreams are closed *before* the test loop is shut down
and replaced. If old IOStreams are collected once the new loop is installed, they will
close fds that are in use by the new test.