I had this issue with my sti and it would actually stall on me as I put the clutch in approaching a stop light. It happened all the time. I actually took it in to Subaru on different occasions and finally they got rid of it by a combo of throttle body/intake sys cleaning and sending the ecu off for a re-flash. I doubt you need the reflash since it was something they did more with the initial 04 sti's. I would start with a can or two of BG44K and then if that doesn't work have the throttle body cleaned. How's your air filter btw?