pbuilder: Enable concurrent Deb builds

Unlike mock, multiple instances of pbuilder or cowbuilder seem to be able
to coexist peacefully.   The main point of contention in a concurrent
Debian build comes when updating the repository metadata file, which
also occurs in the RPM build.  The solution for Debian is slightly more
complicated because of the way the Debian repository metadata tools work.

apt-ftparchive writes the new metadata to standard output, which is then
redirected to the appropriate file.   This causes problems for concurrent
builds because the script takes time to print the new metadata, but the
executing shell truncates the old metadata file immediately.  This means
there is a short period of time during which the metadata file is empty,
and if a concurrently-running build tries to run apt during that period
it will fail.

To avoid this problem, we add a wrapper script which writes the new
metadata file to a temporary file, then moves that into the correct place.
The wrapper script is run under flock, which prevents concurrent update
runs from interfering with each other.

Signed-off-by: Euan Harris <euan.harris@citrix.com>