This commit adds a new AppDataDir function that can be used to get an
operating system and application specific directory to be used for storing
application data.
For example:
dir := AppDataDir("myapp", false)
Would result in:
POSIX (Linux/BSD): ~/.myapp
Mac OS: $HOME/Library/Application Support/Myapp
Windows: %LOCALAPPDATA%\Myapp
Plan 9: $home/myapp
This is work toward conformal/btcd#30.