Check if Rails::Railtie class is defined

Old versions of Rails don't support Railtie.