handle deviceid in base class

As this is required for all agent messages, not just inventory messages.
no more statedir
use broker to handle results