fix error when labeling joinfields with spatialite files

Manually applied the patch from PhilippeDorelo
this should fix bug #7068
Merge remote-tracking branch 'origin/master' into qgisMapserver_proxy