Only try to reconnect ActiveRecord connection if ActiveRecord is present

This fixes #127