ENTMQ-566 - make sure we return pool before we stop discovery agent