Feature riemann threshold

This adds a mechanism allowing to attach a threshold check status to outgoing events in `write_riemann`. This allows purely passive monitoring and explitely avoids sending different events (like the threshold plugin does for instance).

Most of the code is stolen from threshold.c, I'll see what I can factor out and how, if the intent is understood and agreed upon.