WFA::clear(): fix bug with state removal.

Old version was removing states from a collection it was iterating over.
WFA::eraseState: fix memory bug I introduced a little bit ago

Original version didn't remove states from state_map. I didn't want this (keeping state_map and Q in sync) so I removed and deleted them. But that caused other problems, so now WFA stores separately a list of states it should delete on its destruction.

This is kind of bad that we have to do it this way, but I don't see any other alternative that keeps the 'state_map ~ Q' invariant I want and doesn't change everything.
Broken stuff for collapseEpsilonChains