Portability: don't use stat(2).

Use glib's wrapper.