Measurement of charge-exchange and ionzation cross section of 40–4000 keV hydrogen ions and atoms in lithium