fix segfault

Indeed, we need to free the data structure once
ncurses has been stopped. Between the two instructions
the other thread could try to display an entry that does
not exist anymore.
do not use regexp anymore