Use the FSID as the device identifier where possible
The device number returned by stat() in st_dev is not persistent in many cases. Btrfs subvolumes or partitions on NVMe devices are assigned device numbers dynamically, so the resulting device ID is typically different after every reboot, forcing Baloo to repeatedly reindex all files.
Fortunately, filesystems like Btrfs or ext4 return a persistent unique filesystem ID as f_fsid from statvfs(), so we can use that when available. Other filesystems like XFS derive the FSID from the device number of the underlying block device, so switching to the FSID does not change anything.
(cherry picked from commit c735faf5)