Roles of hydrogen and nitrogen in p-type doping of ZnO