Cherry-picked fix for QCollator on Mac

Change-Id: I37278ea239acf498f7eb387e17b52ecac6cb4039