Fixes nested has_many links in JSONAPI

When linked resource had has_many links, all of them would use the
association from the first resource, causing all of the items to build
`links` with the same associations.

This fixes it by iterating over the serializers, not just the
attributes array.
So, It can be `Serializer` or `ArraySerializer`. If it's `Serializer`, I convert to `[Serializer]` so I can treat them all equally, without the need for duplicating the logic, eg.

```ruby
if serializer.respond_to?(:each)
  serializer.each  
    do something
  end
else
  do something
end
```