OFStateManager: retry deleting groups referenced by others

Deleting a group may have the side effect of decreasing the refcount of another
group. When we're deleting all groups we need to handle chaining by deleting
the groups that reference other groups first.