Superconducting optoelectronic single-photon synapses