rmtree: import more code from slapos.core to support case of parent directory not writable

Status Job ID Name Coverage
  External
passed SlapOS.Buildout.UnitTest-FixRmtree.Python2

00:13:11

passed SlapOS.Buildout.UnitTest-FixRmtree.Python3

00:26:42