Connection circuits to selectively connect loudspeakers or headphones to amplifiers