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