Refactor daemon.attach()

Also makes streamConfig Pipe methods not return error, since there was
no error for them to be able to return anyway.
This is racy code. Probably it is time to get rid of this.