Influence of dislocations and twin walls in BaTiO3 on the voltage-controlled switching of perpendicular magnetization