Fix NameError when displaying error messages for timed-out commands.

As reported in #158 by @vblessing, when a subcommand times-out (which is too often to my taste) we get a `NameError` instead of the expected error message. The same problem happens for both image, registry and container providers due to code duplication. This modest (and untested) PR should fix it.