The companies said their vaccine helped prevent the return and spread of melanoma in a trial that involved more than 1,000 patients.