Fix for too many open filehandles error on startup.

The client was not being closed properly during the is_up loop,
this explicitly closes it.