"wait" in a subshell wrongly tries to await the main shell's job (2)
#19497 has not been fully fixed.
yash -c 'sleep 10& (echo 1& wait; echo 2); :' is OK, but yash -c 'sleep 10& (echo 1& wait; echo 2)' is not.
Dash and ksh seem to have the same kind of bug.
Fixed in r3969