libcontainer: Bail on close(2) failures
libcontainer: Bail on close(2) failures

Don't ignore close(2) return code, rather bail if there is any
unexpected failures. By checking the close return code we make sure we
don't introduce the same bug (closing an already closed fd) I've fixed
in the previous patch.

As a side note, we are not handling in this patch when close(2) returns
EINTR and the go runtime, since go 1.14, sends SIGURG to preempt
goroutines. This should not happen here though, as nsenter is guaranteed
to be executed before the go runtime starts.

Signed-off-by: Rodrigo Campos <6dfa9cecb562e345739f2e4eb69e9ebd0fbff687@kinvolk.io>

kolyshkin/runc,dqminh/runc,rhatdan/runc,dqminh/runc,opencontainers/runc,dqminh/runc,opencontainers/runc,rhatdan/runc,kolyshkin/runc,rhatdan/runc,rhatdan/runc,opencontainers/runc,opencontainers/runc,kolyshkin/runc,kolyshkin/runc,dqminh/runc