Gather loans for static items

We currently gather loans for static items that are defined within
functions. This change enables loan gathering on static items declared
globally.
Forbid borrow of static items with unsafe interior