Multithreaded N-queens in C++11