Share code between sync and async hasMany

Also create an error message if a relationship is not marked sync but
the records aren't synchronously available.