fix error when labeling joinfields with spatialite files

Manually applied the patch from PhilippeDorelo
this should fix bug #7068