rt/core: impl os::getcwd() in rust ref #4812
core: rt/core: impl os::env() in rust ref #4812
rt/core: port os::list_dir to rust ref #4812
core: change import of exchange_alloc for win32 os::_list_dir
core: fix broken tests on windows
core: formatting appeasement
core: link pthreads explicitly in linux build
core: convert asserts to fail_unless!
core: Convert obsolete fn syntax
auto merge of #5322 : brson/rust/4812, r=brson

Supersedes #5013