active_record: performance improvement in setup_jndi_factory

Implement JdbcConnectionFactory using the class & mixin pattern
instead of using a block.

This has been reported upstream as:

  https://github.com/jruby/activerecord-jdbc-adapter/pull/588

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>