On the stochastic maximum principle with “average” constraints☆