Fix regression in docker module when client is spawned
Fix regression in docker module when client is spawned

PR #39597 broke this module by introducing an UnboundLocalError. This
fixes that error.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt