Modified tex2pdf to fail without hanging

This can happen when files are missing. pdflatex asks for files via stdin, but
tex2pdf is capturing stdout to make up for pdflatex not providing a valid
integer return code to indicate failure.

This patch aims at #49.