pathHelpers: getPathVariants: Use os.path.expanduser() to replace ~
Don't create side-effects in asserts!
(Several asserts were calling lock.acquire(), which is poor form.)
Fixes #132.  Fixes #133.