gSeaGen: The KM3NeT GENIE-based code for neutrino telescopes