Merge pull request #23 from mkurkela/fix-close

Do not have debug printout if stderr is closed. Fixes #19.