Fix race condition in deaagent

Signed-off-by: Georg Apitz <gapitz@pivotal.io>