Close reader on exceptional paths

Also tidy up duplicate readLine calls.
Merge pull request #20 from andrewgaul/reader-exceptional

Close reader on exceptional paths