Single-shot time-resolved magnetic x-ray absorption at a free-electron laser