Have Task manage its mem fd.

Semantics-preserving refactoring down the road of #801 / #802.

Turns out we can't away from reopening that fd.  My first patch had the fd opened on demand, but the reopen was still required.  Oh well.