Revert "Revert "Fixed compilation for VS2010/non-C++11 threading code (nullptr is not suited for those arguments are they are integral types, NOT pointers).""

This reverts commit 60459cedd62737bd93381b9913398f2ac4808f1b.