Rings whose total graphs have genus at most one