OC-7471 - new_resource.cookbook_version is nil for some resources

Since the existing tests mocked out Resource#cookbook_version it missed
the case where if Resource#cookbook_name is nil then cookbook_version would
also be nil.

Added guard logic around setting the cookbook_name, cookbook_version
in resource_reporter.rb to protect against the case where cookbook_name
is nil.