cleanpath: really process paths starting with "~user/" properly