Before the Catalonia crisis, Spanish Prime Minister Mariano Rajoy's popularity ratings were in the doldrums.