elfutils: rewrite nested functions, fix types, remove variable length arrays in structures

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.
Variable length array in structure extension is not supported by clang. So this
needs to be removed to to allow it to compile with clang. It is replaced with
alloca()s.
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.