create parent dir of dotfile if it does not exist

(the ipython conf file triggered this bug on a fresh machine)