Fixes #179 -- expand ~'s in the path to a key file