Speed up portsclean by a factor of ~60.

Instead of calling 'pkg which' for every single shared lib in the system,
put it off until we know we're going to need the pkgname for something.