High-resolution X-ray spectroscopy of the stellar wind in Vela X-1 during a flare