build: Fix race on generated file when parallel building