Average consensus in switching nonlinearly coupled networks with time-varying delays