Ultrathin coatings for enhanced durability in (photo)electrochemical hydrogen production