[PATCH 4.19 071/129] test_firmware: prevent race conditions by a correct implementation of locking