Ensure Docker client uses exit codes when errors occur

This patchset essentially ensures that the Docker client actually exits with error codes if an error is encountered.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)

/cc @shykes @vieux @crosbymichael
@LK4D4 There, I've added an extra commit which changes the interface to use `struct` values instead of pointers.