Large anisotropy of electron and hole g factors in infrared-emitting InAs/InAlGaAs self-assembled quantum dots