Fix polymorphic eager load with foreign_key as String.

The foreign_key could be `String` and just doing `owners_map[owner_key]`
could return `nil`. 
To fix this bug, we should `to_s` the keys if their type are different.

@seanlinsley Thanks for the test case.

cc @jeremy 

Fixes #14734.