Merge pull request #4104 from gilles-peskine-arm/test-mutex-usage-count-development

Test and fix mutex usage