Fix *_ids method for has_many with primary_key

A `has_many` association with a custom `primary_key` was using the wrong primary key field name to find the list of associated IDs.

See https://github.com/rails/rails/issues/14439 for details.
There might be more scope for getting rid of the conditional in the `source_reflection_pk_column_name` method, but I'd need to look at the code in more detail to figure out all of the possible cases.