Fix setting a polymorphic association's attributes to nil and saving, if that association had been non-nil and loaded.

This raised a nil deref, because the stale_state test returned true (the target was no longer valid) and so #find_target called #scope, which ran klass.all - which failed because #klass is now nil.

This only happened if saving the record holding this polymorphic association, as opposed to say referencing the association, because the latter is implemented by the SingularAssociation#reader method which called #reload if the target was stale.  This patch does something similar, but a bit less radical (calling reset).
Revert "Revert "Merge pull request #11120 from awilliams/ar_mysql2_boolean_quoting""

This reverts commit 12891e98a6c6af43bd8eda0b9eecfe5b14500670.

Re-applying this fixes validates_uniqueness_of on boolean columns.