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.
Merge pull request #168 from harlowja/ok-close

Only close if not None