waf: fix concurrency issue with duplicate targets