Use IO#closed? instead of temp file count to test file closure in spec

Hopefully this takes care of the spurious spec failures described in
issue #163.