Fix #10100.

- If a package is already installed, look up its installed location and
  use that when initializing the package manager for uninstallation,
  otherwise we'd potentially fail to find the package, and consequently
  fail to remove it.