[Haskell-beginners] Buggy behavior of "withFile"