staging: Avoid sysroot removal races
Currently a task could remove a dependency needed by another task leading
to build failures, often due to missing dependencies (e.g. dynamic libraries
not being found). This was often seen for all-arch recipes in package_write_rpm.
When removing a dependency, first check that no other task active for the
recipe has that same dependency.
(From OE-Core rev:
ff3617cc2cd5618f48a25aa4e3b2014430fcbe23)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit
3de078642925e720c2fca5b89cd3abb8b29d2439)
Signed-off-by: Armin Kuster <akuster808@gmail.com>