JSONAPI Serializer bugfix

A relation can sometimes be set to null. In JS, `typeof null === 'object'`, and
a condition wasn't taking that case into account, allowing `Object.keys` to be
called on `null` (non object).