[PATCH v4 2/2] kunit: avoid memory leak on device register error