elf: don't use get_program in program context

Using ELF namespaces (unmerged) together with application's patch (unmerged),
leads to problems. The problem occurs because we have lines like this:

    elf::get_program()->some_function()

being called in a program context.

Because this can be called at a time where the application context is still not
fully ready, "this" will point to an address, while "get_program" will point to
another. That leads to a crash later on.

While of course it is possible to squeeze the patchsets to produce correct
results, I believe the above code is wrong and should be fixed independently.
Once you have a pointer to a program, any resolution method called from that
instance must refer to that particular instance, and *not* to the instance of
whoever is calling it.

This patch fixes two users of this pattern.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>