MADRID — Just as Spain’s financial troubles seemed to be diminishing, Prime Minister Mariano Rajoy has become engulfed in a widening corruption scandal involving payments to the leaders of his Popular Party.