Fix '~' in xterm title for Ubuntu 14.04 and 12.04

This is annoying.

bash 4.2 from Ubuntu 12.04:

   $ cd
   $ echo "${PWD/#$HOME/~}"
   ~
   $ echo "${PWD/#$HOME/\~}"
   \~

bash 4.3 from Ubuntu 14.04:

   $ cd
   $ echo "${PWD/#$HOME/~}"
   /home/mg
   $ echo "${PWD/#$HOME/\~}"
   ~

This workaround works with both:

   $ cd
   $ __tilde="~"
   $ echo "${PWD/#$HOME/$__tilde}"
   ~