Fix concurrent uploads that share layers Upstream-commit: 621a148da3631dd19eee724fb87cf00762aef4a3 Component: engine