rdmd: Use a lock file to synchronize concurrent builds in the same workDir

This is an alternative to pull #95, using lock files.