Compilation fix: #elseif is not understood by all compilers.

Replaced it with #elif, which is.
Fixed "QThread: Destroyed while thread is still running" warning.

Also, fixed a memory leak: each switch of the backend leaked a parser
object instance.