Make sure docker kill exit with failure in case of error

Fixes #2623