Spanish Socialists and Catalan Junts reach deal for government support, amnesty