Use toLatin1() instead of toAscii() for Qt5-compat

Since we don't call QTextCodec::setCodecForCStrings()
QString/QByteArrays::toAscii() is the same as toLatin1() according to
the Qt4 documentation.

In Qt5 toAscii() got removed completely.