tests: clean up unused parameter warnings
Fix TSS when targeting Windows from compilers other than MSVC.
Implement mtx_timedwait on non-Windows platforms.
Switch from (POSIX) clock_gettime to C11 timespec_get.

clock_gettime + the TIME_UTC define from TinyCThread stopped working
with glibc >= 2.16, when TIME_UTC was added to glibc.  TinyCThread
was assuming that if TIME_UTC was defined it would have the same
value as CLOCK_REALTIME, but this wasn't the case—glibc defines
TIME_UTC as 1, but CLOCK_REALTIME is 0 and CLOCK_MONOTONIC is 1, so
calls to clock_gettime(TIME_UTC, ts) were actually requesting
monotonic time.
Add unit test for mtx_timedlock.