This termonology change affects lots of function names from `pkg/lib'
and `pkg/db' (former `pkg/pnr-db'), and it also affects some `raco
pkg' commands.
Existing package installations that are marked as 'pnr in a
local configuration are converted automatically to 'catalog, but any
existing "indexes" configuration must be changed to "catalogs".
Make the installed-package database lock reentrant, change some
functions to take the lock, and fix the documentation on when a
lock is expected to be taken outside of functions.