Fix newline remote command execution

Fixes the issue documented in the following disclosure:

http://seclists.org/fulldisclosure/2014/Apr/240