Prevent Rails console log twice

When `config.logger` is set in `development.rb`, for example, the console log is printed twice.

By default, Active Record sets a Logger for the console. Now we check if there is a Logger set in Rails configuration before Active Record instantiate its own.

Fixes #11415.