Added safe lock for upstream mirrors

Change-Id: I0166ae136d462af1ba7672ffcbbffae2c92285ef
Partially fixes bug: #1373632
Added safe lock for product mirrors

Change-Id: I606119816f9e5265093dee4e8743682a4a9b72ee
Partially fixes bug: #1373632
Merge "Added safe lock for product mirrors"