Quantum nanomagnets in on-surface metal-free porphyrin chains