persist-state.h: Made a few function static and removed prefix from static functions.
persist-state: Factored out wait for mapping release.
persist-state: Fixed persist_state_cancel and _free inconsistency.

Calling persist_state_free after persist_state_cancel caused a segfault,
because the state was zeroed out during cancel,
but we didn't create some fresh new elements in the state, so _free
tried to free up some invalid pointers.
This is now fixed, cancel initialize the full state to it's default state.
Merge pull request #58 from balabit/f/persist-cleanup

F/persist cleanup