Wait for directory to be created if it does not exists