client-event is guaranteed to be dispatched now after the last update of status/stats/currentsong/outputs

Previously a client-event could be triggered before even a status was fetched.
This would be incositent and somewhat painful. Now it is triggered afterwards.

Also api.h was cleaned, and locking stuff moved over to protocol.h (from update.h)
Bg
Working on zeroconf support.