Covariance in the Batalin–Vilkovisky formalism and the Maurer–Cartan equation for curved Lie algebras