Make dotenv task thread-safe to fix duplicate prompts