BZ-1015054 - Building a project twice at the same time may cause problems

(cherry picked from commit a22df999d541d97858f65ae8153f79bb533d292f)