Moved the check for the rails test environment into rails/test_unit so that you
can select frameworks separately when running rake test.
Remove code duplication
Fix a SystemStackError that occurs when using time zone aware attributes.

This fixes issue #10066
Added testcase for #10067 and a CHANGELOG entry about this change.