stat: check if ctime_r() ends in a newline before stripping