Lock state before we modify.

When we start a container we lock state, we should do the same in stop.

Detected via -race.

See Issue #713