Acting Spanish PM on verge of second term after controversial Catalan amnesty deal