zero counter when unregistering

Need to use LIST_FOREACH_SAFE to unregister while modifying the list.
debug_counter: remove extra printf argument
debug_counter: document maximum string lengths