Fix error/debug messages in Container.Attach and recover from ErrClosedPipe

- debugging messages in container.go now use a homogeneous format: `funcname: error condition` (all lowercase, no square brackets)
- when reading from a closed pipe, we silence `io.ErrClosedPipe` errors to avoid spurious error messages during tests
- added and expanded some comments
- improved debugging output for `Container.monitor`