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