libpacman: Move localdb functions do localdb.c