Issue #23162:improve performance of getlocationid with index

This should be tested on the updater before it's pulled in. I've moved the safe_toolkit straight into the foundation manifest, so functions like https://github.com/xtuple/xtuple/blob/master/lib/orm/source/xt/functions/add_column.sql will be in our foundation code. The updater seemed to have some problems with this, and I thought it was due to the $$. But the updater has been able to deal with https://github.com/xtuple/xtuple/blob/master/foundation-database/public/functions/receipts.sql the whole time.