Add 2 patch to fix threading issues.

See also https://github.com/cms-sw/cmssw/issues/1941#issuecomment-31641060