precompile: Fixed program leak in inherit of strings.

The generated code leaked the inherited program.

Also improved robustness against resolver errors.
Compiler: Added resolve_program().

Added helper function resolve_program() to simplify resolving of
program symbols during compile-time for C-modules.

This function is used from precompiled code when inheriting
strings (API level 5).