Fix not to attempt to close a file handle that is not open.

Fixes issue #36 for me, not attempting to close a file handle that is not open.

Came across this issue when upgrading perl to v5.18.2 from v5.12.5.