Workaround for race condition in fnmatchcase

Change-Id: I9748c72976f595eea823970c43bef4d048520b2c