GEOT-4757: ReferenceType encodes xlink:href with null values

The change is very simple. It checks if gml:id is not null before encoding an xlink:href from it. This is to avoid always getting xlink:href="#null" for complex features. Test added. Thanks.