avoid race condition in profile creation

ignores EEXIST, which can happen when two processes are starting up at the same time on the same new profile.

Centralizes some of the mkdir code in a new method, reducing some duplication.

closes #3218