Stress-induced phase transition in ferroelectric domain walls of BaTiO3