Add locking on rpm_repo creation

This commit enables locking on repo creation for the rpm packages that jenkins
builds, in order to avoid us colliding with other repo creations. We loop until
the lock is released. Repo-creation takes along the order of 1-2 seconds. It
also removes various places where single quotes would obvious double quote
escapes, to make the code a bit more readable, and removes duplicate checks for
directory structure.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add locking for debian repo creation

This commit enables locking on repo creation for debian packages that jenkins
builds, in order to avoid us colliding with other repo creation. It operates in
the same manner as the previous commit.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>