Task stuck pending if cloud worker terminates

We found a PENDING task whose worker had been terminated due to idelness.

A couple of bugs here:

  • Pending tasks should block idle-termination.
  • Pending tasks should be de-assigned on instance termination.