Have read_message exit process on EOF

Reading an EOF from stdin effectively means the parent process (Storm)
is dead and we should just kill ourselves.

Also fixed a few bugs (num_blank_lines instead of blank_lines) and
formatting.