Fix #9148 (data-defined label positions with postgis)

A bit strangely, conversion of null variant with double type
to a double value is considered ok by QVariant
Fix move label tool with PostGIS (similar problem as #9148)
[layertree] Fix possible crash when removing layers