When writing the output of a command, escape all non-printable characters by default

Signed-off-by: Olaf Kirch <okir@suse.de>
When running a process inside a terminal, give it a dummy TERM=vt100 env var

Signed-off-by: Olaf Kirch <okir@suse.de>
ni_file_write_safe: always write a newline at the end of output

Signed-off-by: Olaf Kirch <okir@suse.de>