elfutils: rewrite nested functions and fix types

Replace the nested functions with actual functions outside the function
body to avoid compiler errors with clang. This works in gcc because gcc
supports nested functions but clang does not.
pseudo: remove non-constant static initialization

C standard doesn't require support for non-constant static initialization
but pseudo uses those anyway because it's just a compiler warning in gcc.
This fails for clang so we should remove this. It doesn't change the logic
of the function anyway.