Ensure that the curses mutex is unlocked before we return