nvdimm: fix memory leak in error code path