Fix crash with non-existing custom ID_FIELD.

A custom ID_FIELD would crash on GET requests to resource endpoints if
one or more documents were missing the ID_FIELD (probably because they
were created before the custom ID_FIELD was set). The crash would happen
while building the HATEOAS link to the document.

In general, documents like this are bogus since they miss the only field
which would allow them to be retrieved, edited and deleted. This 'fix'
avoids building the document link if the active ID_FIELD is missing for
the document, which in turn allows GET requests on the resource
endpoints to function properly.

An extreme alternative would probably be to skip documents like these as
they don't validate against the current API settings.

Closes #351.