(maint) Fix problems when loaders get static environment

When doing special things in benchmarks or tests, the new
function loaders may get a static environment. That means that
such an environment can not be used to load functions from (and
that is a feature that is required when environment specific
data is turned on).

There was already protection against legacy environments in general,
but not for the special cases of passing in a Static (bootstrap)
environment - which is never used in real code.