X2 on advise from Biglake..... Also some slight tweeks of the TPS base line might be needed - which can also help to richen the idle mixture and reduce such problems. ( Also just a simple adjustment of the base idle speed could help if it's at the lower range of the recommended specs - but best to adjust idle speed after the TPS has been set ).
Anyway if you can please check to see what your bike's current CO & TPS settings are at from factory - as this may give an indication of how much these 2 factors could be effecting your stalling condition..... I have added the link below of a very good thread from this site about how to check / adjust the TPS.
https://wr250rforum.forumotion.com/t5568-throttle-on-off-at-idleAlso if you find that your TPS does in fact require a slight adjustment - then i would very strongly suggest and highly recommend to replace the stock NGK spark plug with a High performance NGK Iridium plug, as this will also help with more efficient combustion etc.
( As to adjust the TPS you will have the fuel tank removed - so now is the time to access & up-grade the spark plug ).
Ok, so check into the above and report back please mate with your factory settings.
Cheers, Gavin.