Hungarian president signs constitutional amendment ending his term as head of state