Theory of H sites in undoped crystalline semiconductors