Do not fail when uninstalling multiple packages that depend on each other

Fixes #306