Robotic swimming in curved space via geometric phase