Mechanism for nematic superconductivity in FeSe