[build-in-chroot.sh] Changelog:

* Lock ${LOCALREPO}/cache.lock before updating package databases
* Split makepkg into two stages: download and build
  - Lock ${LOCALREPO}/cache.lock during the download stage
* Lock ${LOCALREPO}/cache.lock before removing packages from the pacman cache