Allow tilde expansion when opening databases.

Using expanduser on windows returns the path unchanged.