Strip whitespace from subshell output.

* Trailing line breaks are removed.
* Any whitespace is collapsed down to a single space.