The first two lines register and then fail to re-register; meaning we have one registered for `foo`.

The second two lines unregister `foo`, and then fail to unregister it; meaning we have zero registered.

The final two lines register `foo` and then unregister it.  This should succeed.