Lock global scope

We now have two "global" scopes: global, where the stdlib lives, and
semi-global, or module level. The former is read-only. Note that
setglobal now operates on the semi-global level, while getglobal still
operates on the global level.
Fix possible bug if realloc fails in read_all()
Fix reading undefined variable in prompt.c
Remove useless variable