Fix newline remote command execution

Fixes newline remote command execution issue detailed in http://seclists.org/fulldisclosure/2014/Apr/240.