libpacman: Move package integrity checking code to a function.