glib: Don’t use time(NULL) to get current time
Use either g_get_real_time() or g_date_time_new_now_local(). This means we don’t need to worry about time_t being 32b in future (the year 2038 problem), and it makes the need for error handling a bit more explicit. Improve the error handling in several cases.
Based on a patch by Niels De Graef (!142 (closed)).
Signed-off-by: Philip Withnall withnall@endlessm.com
Closes #1402 (closed)