Made directory create thread/process safe