Possible race fix
We are seeing issues, this might fix them (a quick test during GUADEC suggests it actually does).
Would be good to wait a bit longer; @carlosg is running the patch for now to see if he continues to run in to the issue. Either way, the patch should be safe to merge.