Port GettextImportPlugin::codecForDevice away from QTextCodec
Returns the codec name now, as for Qt6 the the actual encoders/decoders are stateful objects and as such are better created on the spot.
Implementation gets a bit messy as we need ifdefs now, but given we are approaching the end of the port anyway I guess that's acceptable for now.