The role of mechanical boundary conditions in the soft mode dynamics of PbTiO3