Fix memory leak and refactor parts of BaseApplication
Fix memory leak and refactor parts of BaseApplication

- Fix memory leak of class-owned argv copy (macOS)
- Use plain C for checking of arg prefixes instead of QString
- Move deletion of Impl member vars into Impl dtor
- Manually manage m_QApp in preperation of refactoring in the
  context of this member variable as application exit causes
  thread-related warnings

fmilano/mitk,MITK/MITK,MITK/MITK,fmilano/mitk,fmilano/mitk,MITK/MITK,MITK/MITK,fmilano/mitk,MITK/MITK,fmilano/mitk,fmilano/mitk,fmilano/mitk,MITK/MITK