try to create database directory if missing and fix ownership if in conflict with given user/group