Optical mode softening in the incommensurate phase of Sr2Nb2O7