Fix some issues with locking on the container Upstream-commit: 3d80a692d146e10282bacc0dd2698ffd32dcdaae Component: engine