Ensure we are returning either `true` or `false` for `#==`

460eb83d cused `ActiveRecord::Base#==` to sometimes return `nil` in some cases,
this ensures we always return a boolean value. Also fixed a similar problem in
AR reflections.