Quartararo takes pole at Spanish MotoGP, Rins injured in crash