Fix yasnippet-mode behavior in term-mode.