Allow images to be saved and loaded by id and repository
Merge pull request #2793 from crosbymichael/offline-ids

Allow images to be saved and loaded by id and repository
Lock state before we modify.

When we start a container we lock state, we should do the same in stop.

Detected via -race.
Merge pull request #2795 from pnasrat/docker-testmultipleattachrestart-race

Lock state before we modify.