auto_build: Fix major bug with two processes modifying same file at same time