Fix deinstallation of stale ports

It's mostly a hack, it should be replaced by pkg autoremove as soon as
it works.
Fix listing of installed ports by categories

The logic had to be completely inverted, the loop had to be modified
to actually use the global variables, and, while I was here, I also
declared a couple of local variables and fixed style. Tududu.
Exit immediately from update_required_by()

The function is not going to be called anyway, but this change ensures
it cannot do any damage.
Fix typo
Make --clean-packages work with any package format

portmaster will just try extracting origin information from the
package, be it old, new, .txz, .tbz, .tgz or .tar.
Enable --check-port-dbdir

This option is actually useful even with pkgng.