systemd: fix setting kernel memory limit
systemd: fix setting kernel memory limit

since commit df3fa115f97407713ec6ebe37a5ccf13b81dafd2 it is not
possible to set a kernel memory limit when using the systemd cgroups
backend as we use cgroup.Apply twice.

Skip enabling kernel memory if there are already tasks in the cgroup.

Without this patch, runc fails with:

container_linux.go:344: starting container process caused
"process_linux.go:311: applying cgroup configuration for process
caused \"failed to set memory.kmem.limit_in_bytes, because either
tasks have already joined this cgroup or it has children\""

Signed-off-by: Giuseppe Scrivano <20002b7b24c75512093a71a58285826d5c504fca@redhat.com>

dqminh/runc,estesp/runc,opencontainers/runc,xiaochenshen/runc,mheon/runc,adrianreber/runc,rhatdan/runc,mYmNeo/runc,opencontainers/runc,mheon/runc,kolyshkin/runc,mikebrow/runc,crosbymichael/runc,estesp/runc,mikebrow/runc,rhatdan/runc,mYmNeo/runc,dqminh/runc,estesp/runc,mYmNeo/runc,opencontainers/runc,dqminh/runc,xiaochenshen/runc,rhatdan/runc,justincormack/runc,xiaochenshen/runc,kolyshkin/runc,dqminh/runc,adrianreber/runc,crosbymichael/runc,mheon/runc,rhatdan/runc,kolyshkin/runc,adrianreber/runc,mikebrow/runc,justincormack/runc,crosbymichael/runc,kolyshkin/runc,opencontainers/runc,justincormack/runc