Upper critical field divergence induced by mesoscopic phase separation in the organic superconductor (TMTSF)2ReO4