Only print a newline if data was printed.

This commit prevents newlines being printed after an empty message was
provided to out() (usually due to an empty message being provided by
in()).