BasicManagement: Wait for both (out/err) streams to EOF

Sometimes stdout is closed before an error message is sent to
stderr: wait for both to close before finishing one iteration.
BasicManagement NSLookup: handle another case of unresolved name server