patch 8.1.1313: warnings for using localtime() and ctime()

Problem:    Warnings for using localtime() and ctime().
Solution:   Use localtime_r() if available.  Avoid using ctime().
diff --git a/src/undo.c b/src/undo.c
index 1d26144..2f1924c 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -3110,11 +3110,19 @@
 u_add_time(char_u *buf, size_t buflen, time_t tt)
 {
 #ifdef HAVE_STRFTIME
+# ifdef HAVE_LOCALTIME_R
+    struct tm	tmval;
+# endif
     struct tm	*curtime;
 
     if (vim_time() - tt >= 100)
     {
 	curtime = localtime(&tt);
+# ifdef HAVE_LOCALTIME_R
+	curtime = localtime_r(&tt, &tmval);
+# else
+	curtime = localtime(&tt);
+# endif
 	if (vim_time() - tt < (60L * 60L * 12L))
 	    /* within 12 hours */
 	    (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime);