Fixed a race in long lived executor.
Fixed a race in long lived executor.

There is a possible race condition when the \`TASK_FINISHED\`
update calls into \`update\` when the executor process might
itself be already executing. Also after this fix, even if the
executor is disconnected from the agent by the time the `update`
function is called, the updates would be sent again as part of
unacknowledged updates on re-registration.

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

zmalik/mesos,verizonlabs/mesos,abudnik/mesos,dforsyth/mesos,verizonlabs/mesos,asamerh4/mesos,reneploetz/mesos,Gilbert88/mesos,chhsia0/mesos,Gilbert88/mesos,asamerh4/mesos,asamerh4/mesos,yuquanshan/customizedMesos,chhsia0/mesos,abudnik/mesos,jpeach/mesos,kaysoky/mesos,reneploetz/mesos,chhsia0/mesos,verizonlabs/mesos,reneploetz/mesos,Gilbert88/mesos,kaysoky/mesos,jpeach/mesos,kaysoky/mesos,dforsyth/mesos,Gilbert88/mesos,chhsia0/mesos,zmalik/mesos,gsantovena/mesos,craimbert/mesos,craimbert/mesos,jpeach/mesos,gsantovena/mesos,asamerh4/mesos,craimbert/mesos,Aman-Jain-14/customizedMesos,abudnik/mesos,jpeach/mesos,dforsyth/mesos,gsantovena/mesos,jpeach/mesos,kaysoky/mesos,Aman-Jain-14/customizedMesos,dforsyth/mesos,zmalik/mesos,kaysoky/mesos,yuquanshan/customizedMesos,neilconway/mesos,dforsyth/mesos,Gilbert88/mesos,reneploetz/mesos,zmalik/mesos,dforsyth/mesos,chhsia0/mesos,andschwa/mesos,andschwa/mesos,asamerh4/mesos,kaysoky/mesos,neilconway/mesos,verizonlabs/mesos,abudnik/mesos,zmalik/mesos,verizonlabs/mesos,craimbert/mesos,craimbert/mesos,yuquanshan/customizedMesos,neilconway/mesos,asamerh4/mesos,andschwa/mesos,abudnik/mesos,craimbert/mesos,jpeach/mesos,asamerh4/mesos,kaysoky/mesos,craimbert/mesos,verizonlabs/mesos,reneploetz/mesos,Aman-Jain-14/customizedMesos,yuquanshan/customizedMesos,yuquanshan/customizedMesos,reneploetz/mesos,Gilbert88/mesos,andschwa/mesos,dforsyth/mesos,Aman-Jain-14/customizedMesos,gsantovena/mesos,gsantovena/mesos,Gilbert88/mesos,neilconway/mesos,neilconway/mesos,Aman-Jain-14/customizedMesos,abudnik/mesos,neilconway/mesos,abudnik/mesos,Aman-Jain-14/customizedMesos,gsantovena/mesos,chhsia0/mesos,gsantovena/mesos,yuquanshan/customizedMesos,jpeach/mesos,yuquanshan/customizedMesos,Aman-Jain-14/customizedMesos,reneploetz/mesos,zmalik/mesos,neilconway/mesos,zmalik/mesos,verizonlabs/mesos,andschwa/mesos,chhsia0/mesos,andschwa/mesos,andschwa/mesos