gom: Correctly 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.

Previous commit was trying to do that, but ended up ensuring that the
names were at least as big as the byte array we store them in, rather
than the (correct) opposite.
tests: Fix the unit tests

The unit tests were setting the primary key before the property existed,
which used to be silently accepted until commit f416919.