Complex dynamics in a relay feedback system with hysteresis and delay