vendor dir is not accessible before install, sqlite db dir write check moved into db class

@tcitworld, you are right - #813 is a bug. This pull request should help.