Refactor daemon.attach()

Also makes streamConfig Pipe methods not return error, since there was
no error for them to be able to return anyway.
Maybe I'm missing something, but this is `err` from outer scope of closure, probably better to use local variable to avoid races, and you anyway synchronize your code with channel.