Guarantee that native tasks wait for children

There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.
auto merge of #11315 : alexcrichton/rust/issue-11309, r=huonw

There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.

Closes #11039