MDLSITE-2312 optimize looking up of urls for perf increase to get_site_by_url() to prevent xmlrpc call timeout on client/moodles

there are updates aside from the main commit reason - this is due to xmldb updating the install.xml due to its own updates.