Fix use of _POSIX_THREAD*
This fixes a couple of aspects of behaviour. Formerly, if
_POSIX_THREADS was defined and equal to zero, we might have used
clock_gettime and got some kind of error (compiling/linking/runtime
behaviour). Similarly, if _POSIX_THREADS was undefined, C99 defines
such preprocessor symbols as zero, so we again used clock_gettime
inappropriately.
Now we avoid compiler warnings if the symbol is undefined, and when it
is defined we use clock_gettime only when _POSIX_THREADS_ has a value
such that it is supposed to work.
Adapted this an the BG/Q fix also for
gmx_gettime_per_thread(). Expanded the documentation of why the code
is the way it is. Noted future TODO to consider std::chrono.
Fixes #1980
Change-Id: Ib3e40903e2344354074c5328d40e8467f264b51f