Previously if the prefix was non-existent we would switch to root even if the user does have the permissions to create the directory. Fixes #3585