Working towards a libc-less (wasm32) libstd
This is a series of commits I was able to extract from prepare to comiple libstd on a "bare libc-less" target, notably wasm32. The actual wasm32 bits I intend to send in a PR later, this is just some internal refactorings required for libstd to work with a `libc` that's empty and a few other assorted refactorings.
No functional change should be included in this PR for users of libstd, this is intended to just be internal refactorings.