Properly handle parameter passing in different implementations of std::thread
Fixes #3