Restore fd equality check in fdIsSet for the "pending" fds.
Handle chdir in spawns by using sh.