Streamline font match() function.

Determine writing system before executing the loop.

Change-Id: I6c462bdef4d70860e76c7cc9d939e3e92983b173
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QSystemSemaphore: Clear error after successful operation

Change-Id: I5c1021b2329439e3aefaa1c0d9c0b8a298d285de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>