make caml_time_counter concurrent-safe on macOS (#12234)
Also time counter a uint64_t instead of casting between
signed/unsigned longs on all the platforms. The type
of most of the monotonic counter interfaces is an uint64,
except for Windows.
Fixes #12096
authored by