Embedded quantum-error correction and controlled-phase gate for molecular spin qubits