fix file descriptor leaks (readFile on partially read files)

Found today when ran h-u on my system:
> Searching for Haskell libraries with broken dependencies.
> haskell-updater: /usr/lib64/ghc-7.6.3/gentoo/chaselev-deque-0.4.conf: openFile: resource exhausted (Too many open files)

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>