Fix a dangling pointer use

toLocal8Bit returns a temporary, so we must not keep a pointer to the data
inside it

Change-Id: I8fa4138c15acce0005e304b5206585fcd1a5e56b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>