nmsg_input: raise exception for unhandled results from nmsg_input_read()

previously, we did not handle all possible permanent failures from
nmsg_input_read(). this made it possible for a read() call to spin in an
infinite loop.

for example, an invalid .nmsg file with the wrong magic header value
would cause all calls to nmsg_input_read() to return
nmsg_res_magic_mismatch.

since we legitimately need to restart nmsg_input_read(), e.g. in the
case of a UDP nmsg input and non-blocking I/O is disabled, we need to
use a while loop here. this commit alters the while loop so that it only
restarts the call to nmsg_input_read() when it returns nmsg_res_again.
all other result codes cause the function to return (nmsg_res_success,
nmsg_res_eof) or to raise an exception (any unexpected result code).