Use KIO::stat to check file existence
QFile::exists can be slow when the file is on a remote filesystem, so use KIO::stat to check whether the file exists or not. QFile is not intended to be used in multiple threads, so the old code can possibly cause some crashes according to the bug report.