Do not attempt to close stdout on invocations of "dx head -o -".
Add tests for some dx commands.