Only exists if OpenMP is disabled, returns always 0.
We need the current thread number a couple times, having this function here avoids having to use even more #ifdef in code.