Expand file names before processing them

We need to expand a file name to make it absolute and to process any special symbols before trying to process it.

Fixes an error from projectile-switch-project, when default-directory contains a tilde, e.g. "~/", as is the case in *scratch* and probably other special buffers.