Fix race during build of python bindings