HFile: Fixed possible file handle leak.