Fix #10856, #10789: `::Logger#silence` and `LoggerSilence` troubles

* Synchronization has been added to `LoggerSilence#silence`.

* Fix #10856: search pending migrations among all known migrations, not
  only the latest one. `ActiveRecord::Migrator.needs_migration?` works
  as expected now.

* Fix #10789: `LoggerSilence` included into `::Logger`.

* Revert 3970432fcb6a0: it is very bad idea to use mtime to check if
  there are pending migrations. Suppose you did `db:migrate/db:rollback`
  several times: checking will stop working at all (`db:migrate:status` has
  changed but mtime is not).