Add thread-safe patch for moses 1.0 release.