Fix race condition when building with USE_PCH and COPY_HEADERS_BUILD

See for instance travis build failure for job 257.5.