Add cb_gmtime_r and cb_localtime_r

gmtime_r and localtime_r is POSIX functions and Windows
have their own "secure" versions with _s suffix, but the
arguments are flipped and and the return value inversed.

Change-Id: Ia0b3c34f267f8ad4a603342a0a376af8a20ad9af
Reviewed-on: http://review.couchbase.org/43349
Reviewed-by: Daniel Owen <owend@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>