utimens: work around Linux ctime bug
Force a ctime update by using stat() before any utimensat call
with mtime of UTIME_OMIT. But avoid extra stat()s in later
calls, by doing extra work on the first instance in order to
cache whether the bug is actually present.
* lib/utimens.c (detect_ctime_bug): New helper function.
(update_timespec): Differentiate between workaround needed for
this bug vs. what is needed for systems that lack utimensat.
(fdutimens, lutimens): Work around bug.
Signed-off-by: Eric Blake <ebb9@byu.net>