Fix memory leaks of ast and speller
Also turn a static into Q_GLOBAL_STATIC so it gets properly destroyed on exit and doesn't clutter memory leak investigation
Also turn a static into Q_GLOBAL_STATIC so it gets properly destroyed on exit and doesn't clutter memory leak investigation