Augment SimplifyLibCalls a little to support (a) optimisations involving internal functions (useful when libc is linked already) and (b) promoting realloc(null, x) -> malloc(x)

This is mainly useful because it's a prelude to GlobalOpt's ability to optimise globals that only ever hold mallocs (which ignores pseudo-mallocs like that one).