Hysteresis and defects of spin-polarized edge states in the integer quantum Hall regime