Which OCL runtime are you using and for which platform? Can you identify the version and/or install package you used?
If you're using a runtime that leverages ocl spec >= 2.0 it's slightly different, if read extremely strictly the spec's section A.2 suggests any function that modifies the state of cl_kernel objects is not thread safe.
Consequently, as a future proof solution I recommend staying away from unguarded clCreateKernelsInProgram calls in multiple host threads. My intent here is not to garner a discussion on how the spec should be or is, just an observation for how it can be interpreted.