rt: Use the correct global change_dir lock
auto merge of #8143 : brson/rust/change-dir-lock, r=luqmana