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