gom: Report error correctly when the repository isn't set

gom_resource_save_sync() would fail without returning an error, which
could cause problems.
gom: Add better check on the primary-key property

Make sure that the primary-key property isn't set as a construct-only
property, or that its default value is non-NULL.

Thanks to Mathieu Bridon for the code that needed those checks :)
gom: Check the length of parameters before saving them

Check that the primary-key and table names aren't getting clipped before
we save them, otherwise we'll fail later at run-time.