After being diagnosed with terminal cancer, a generation-defining rock legend reconnects with his band to record 13 final songs