Warn if the cache/log directory is not owned by the current user

Fixes #2285