Use with_connection in module_ancestor_from_real_path

[#56005352]

Use an ActiveRecord::Base.connection_pool.with_connection block around
all database accesses in
Metasploit::Model::Module::Path#module_ancestor_from_real_path so that a
connection does not stay checked out for the Thread in
metasploit-framework.