close open file object returned by mkstemp; hopefully finally fixes the too many open files problem