Don't load AR middleware at all unless AR::Base is defined, #1666