[PATCH v3 2/2] kunit: split resource API impl from test.c into new resource.c