host: Unlock write mutex when attach fails

If this mutex doesn’t get unlocked, the error write will hang trying to
lock at L175.

In practice this was happening when getting the logs for interactive and
non-existent jobs.

Closes #444

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
test: Move Helper cleanup to its own TearDownSuite method

Since the method set of a struct includes methods from anonymous fields,
we can remove any TearDownSuite methods on suites that embed Helper
and only call the Helper cleanup method.

Suites that need to their own TearDownSuite and embed Helper will need
to call cleanup in their implementation.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
pkg/exec: Use host event stream if no attach

If there are no streams to attach to, use the event stream from the host
to get job exit status and error details.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
test: Add HostSuite with tests for failing attaches

TestAttachFinishedInteractiveJob covers #444.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
pkg/exec: Add comments to internal fields of Cmd

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #650 from flynn/fix-attach-fail

Fix attach failure path