Prevent false positives in open file handle test

Noticed by Jenkins when using Java 1.5.
Merge pull request #504 from melissalinkert/file-handle-cleanup

Prevent false positives in open file handle test