Made sure only non-terminal operations use resources.
Made sure only non-terminal operations use resources.

The function 'addOfferOperation' is a high-level function which can be
used to some extent manage the offer operation life cycle in the
master. In addition to managing the lifetime of offer operations, it
also maintains the state of used resources.

We already made sure to never count speculated operations as using
resources in this function. In addition, the function
'updateOfferOperation' is already capable of updating the used
resources when an offer operation becomes terminal.  To complete this
division of responsibilities we in this patch extend the conditional
treatment in 'removeOfferOperation' to also take into account whether
the operation is terminal when deciding on whether to mutate the used
resources.

Review: https://reviews.apache.org/r/64163/

Gilbert88/mesos,andschwa/mesos,kaysoky/mesos,Gilbert88/mesos,kaysoky/mesos,gsantovena/mesos,dforsyth/mesos,andschwa/mesos,abudnik/mesos,abudnik/mesos,dforsyth/mesos,andschwa/mesos,dforsyth/mesos,abudnik/mesos,chhsia0/mesos,asamerh4/mesos,gsantovena/mesos,chhsia0/mesos,abudnik/mesos,abudnik/mesos,jpeach/mesos,chhsia0/mesos,reneploetz/mesos,jpeach/mesos,asamerh4/mesos,dforsyth/mesos,kaysoky/mesos,kaysoky/mesos,gsantovena/mesos,kaysoky/mesos,asamerh4/mesos,asamerh4/mesos,asamerh4/mesos,chhsia0/mesos,gsantovena/mesos,gsantovena/mesos,gsantovena/mesos,dforsyth/mesos,abudnik/mesos,Gilbert88/mesos,andschwa/mesos,jpeach/mesos,reneploetz/mesos,reneploetz/mesos,Gilbert88/mesos,Gilbert88/mesos,asamerh4/mesos,dforsyth/mesos,reneploetz/mesos,kaysoky/mesos,andschwa/mesos,chhsia0/mesos,reneploetz/mesos,reneploetz/mesos,Gilbert88/mesos,abudnik/mesos,jpeach/mesos,andschwa/mesos,dforsyth/mesos,gsantovena/mesos,reneploetz/mesos,jpeach/mesos,chhsia0/mesos,Gilbert88/mesos,jpeach/mesos,jpeach/mesos,kaysoky/mesos,chhsia0/mesos,andschwa/mesos,asamerh4/mesos