ActiveRecord Store works with PG `hstore` columns

Closes #12452

This is a follow-up bug fix to 5ac2341. It also contains a fix where `stored_attributes` were held in a global `Hash` and not on a per `Class` basis.