Reconnect connection if it goes inactive after `set_logger` called

This pull request addresses a failure reported in #290 only when tested with Rails 2.3.
Because of some reason the connection goes inactive after `set_logger` executed.

As this failure does not reproduce with Rails 3.0, 3.1 and 3.2 versions, There may be something in Rails 2.3, but this version is supported only for security fixes only. No deep investigation done.