Move common code to lxc_cgroup_create
Move common code to lxc_cgroup_create

For both the ns_cgroup and the usual cgroup creation, we have to
check if a previous does not exist and remove it if it is empty.

Signed-off-by: Daniel Lezcano <3211518dd4d87cb3f7ee12cb52e14b7fb2bc0446@fr.ibm.com>

thmo/lxc,sapun/lxc,rldleblanc/lxc,JohnPeacockMessageSystems/lxc,bostjan/lxc,hallyn/lxc,regit/lxc,abstrakraft/lxc-android-lxc,federicobriata/lxc,virajs/lxc,federicobriata/lxc,inokappa/lxc,tych0/lxc,caglar10ur/lxc,ysbnim/lxc,hallyn/lxc,ysbnim/lxc,ecarrara/lxc,weizhenwei/lxc,jirislaby/lxc,kylef/lxc,cjwatson/lxc,LynxChaus/lxc,JohnPeacockMessageSystems/lxc,bostjan/lxc,bmoar/lxc,armcc/lxc,armcc/lxc,lisongmin/lxc,regit/lxc,glensc/lxc,szaszg/lxc,smoser/lxc,akshaykarle/lxc,rowhit/lxc,hfuCN/lxc,christiaan/lxc,coconutpilot/lxc-gentoo-new,ojkastl/lxc_Patches,lisongmin/lxc,Pelagicore/lxc,weizhenwei/lxc,coconutpilot/lxc-gentoo-new,christiaan/lxc,bmoar/lxc,akshaykarle/lxc,abstrakraft/lxc-android-lxc,efiop/lxc,cjwatson/lxc,Ponce/lxc,terceiro/lxc,usc-isi/lxc,efiop/lxc,hfuCN/lxc,aeris/lxc,federicobriata/lxc,sapun/lxc,glensc/lxc,smoser/lxc,efiop/lxc,yubo/lxc,ojkastl/lxc_Patches,weizhenwei/lxc,DarknessBeforeDawn/lxc,hkjolhede/lxc,ss1h2a3tw/lxc,ojkastl/lxc_Patches,glensc/lxc,codebauss/lxc,yubo/lxc,hkjolhede/lxc,kylef/lxc,bostjan/lxc,Distrotech/lxc,Pelagicore/lxc,smoser/lxc,GreatFruitOmsk/lxc,hfuCN/lxc,aeris/lxc,caglar10ur/lxc,ostap/lxc,szaszg/lxc,Distrotech/lxc,ysbnim/lxc,major/lxc,ioops/lxc,fwilson42/lxc,ecarrara/lxc,thmo/lxc,usc-isi/lxc,ss1h2a3tw/lxc,rldleblanc/lxc,QingweiPeterLan/cs188-lxc,DarknessBeforeDawn/lxc,ecarrara/lxc,yubo/lxc,JohnPeacockMessageSystems/lxc,caglar10ur/lxc,codebauss/lxc,smoser/lxc,Distrotech/lxc,Pelagicore/lxc,GreatFruitOmsk/lxc,bmoar/lxc,szaszg/lxc,fwilson42/lxc,abstrakraft/lxc-android-lxc,virajs/lxc,christiaan/lxc,lisongmin/lxc,potatosalad/lxc,hkjolhede/lxc,LynxChaus/lxc,ss1h2a3tw/lxc,sapun/lxc,QingweiPeterLan/cs188-lxc,codebauss/lxc,raspberrypython/lxc,cjwatson/lxc,Ponce/lxc,jirislaby/lxc,usc-isi/lxc,regit/lxc,ioops/lxc,ksperis/lxc,raspberrypython/lxc,jirislaby/lxc,ostap/lxc,tych0/lxc,DarknessBeforeDawn/lxc,thmo/lxc,lazy404/lxc,potatosalad/lxc,GreatFruitOmsk/lxc,terceiro/lxc,hallyn/lxc,inokappa/lxc,major/lxc,virajs/lxc,LynxChaus/lxc,aeris/lxc,rowhit/lxc,lazy404/lxc,major/lxc,abstrakraft/lxc-android-lxc,lazy404/lxc,rldleblanc/lxc,terceiro/lxc,raspberrypython/lxc,ojkastl/lxc_Patches,Ponce/lxc,fwilson42/lxc,armcc/lxc,akshaykarle/lxc,rowhit/lxc,ioops/lxc,tych0/lxc,ksperis/lxc,QingweiPeterLan/cs188-lxc,ksperis/lxc