Trim last newline from stdin input.