Strip newline ('\n') characters from safe_run output in detect_version()

The last commit changed the way how we process the output of safe_run()
commands. Now we need to strip newline characters where we don't need them.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Make potentially long-running tasks print output in real-time

Tasks that might run for a longer time should present their output in
real-time if being executed interactively. Otherwise the user might think
the application is stuck.

Signed-off-by: Jan Blunck <jblunck@infradead.org>