Bugfix: Set node state before setting node data.

If the node was deleted in Zookeeper, we cannot upate
its data first -- we have to update its state, THEN
update its data.

This patches this behavior, updates the unit tests to
catch it, and adds a bit of logging.