Only close if not None

If a user calls close from a client on a client
which was never started with its nice to just
do nothing instead of throwing a type error which
is what happens if os.close recieves a None type.

Fixes: Issue  #167