de Branges spaces on compact Riemann surfaces and a Beurling-Lax type theorem