This saving&restoring seems flawed to me due to possible race-conditions... I'd expect each shell had its own copy of /dev/wdir... But I may be easily wrong...
When a rc forks a subshell the child shares the namespace with the parent. If you want the child rc to divorce its namespace from the parent, have it issue 'rfork n'.
There is no race condition; this is documented behaviour. You need to (re-)read the namespaces paper in /sys/doc/names.ps. --lyndon