Batalin–Vilkovisky algebra structures on Hochschild cohomology of generalized Weyl algebras