Microscopic model for the stacking-fault potential and the exciton wave function in GaAs