runtime_vm: Create deleteContainer() helper
runtime_vm: Create deleteContainer() helper

deleteContainer() function is a helper that can be used for cleaning up
containers in case of error. Instead of taking the risk of duplicating
code, let's take the relevant part out of the DeleteContainer(), and
make it available for future uses.

It's important to note that other functions cannot just call
DeleteContainer() directly if they're holding a container's opLock, as
DeleteContainer() would try to acquire the very same lock, causing then
a happy little accident called "deadlock".

Signed-off-by: Fabiano Fidêncio <2931bae082ef9bc04523ba759c03a4778316d48f@redhat.com>

kubernetes-incubator/cri-o,kubernetes-incubator/ocid,kubernetes-incubator/cri-o,nalind/cri-o,kubernetes-incubator/cri-o,nalind/cri-o,nalind/cri-o,kubernetes-incubator/cri-o,kubernetes-incubator/ocid,kubernetes-incubator/ocid