Use glib API for dt_util_is_dir_empty() implementation.

Continued work for #9732.