New routine to check if a directory is empty.

Preparatory work for #9732.
Set id as a constant.
In dt_film_remove_empty() remove empty directory too.

When deleting or moving images the dt folders were properly deleted if
empty but the actual directory on disk was not removed. We now check for
empty folders and remove them.

For #9732.
Merge branch 'del-empty-folders'

* del-empty-folders:
  In dt_film_remove_empty() remove empty directory too.
  Set id as a constant.
  New routine to check if a directory is empty.