[RFC PATCH] kunit: Put checking for existing named resource between locks to prevent race conditions in the Resource API