Added ActiveRecord middleware

To clear active connections after worker is processed. Courtesy of Mike Perham :)