rt: Make some runtime calls work outside of task context
auto merge of #5149 : brson/rust/rt, r=brson

Just a few minor things required for freestanding Rust.