NEXUS-6232: Backporting it to Nexus 2.7.x

Prevent concurrent execution of createrepo on same data

Original PR
https://github.com/sonatype/nexus-oss/pull/334

CI
TBD