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