[PATCH 5.4 134/154] test_firmware: prevent race conditions by a correct implementation of locking