Try to focus on your breathing. I find long deep breaths (thank you, yoga!) help avoid side stitched better than short, choppy breaths. Slow down if you have to.
I've been told also to press on the abdomen right above where the side stitch is. For me this works about 30% of the time, but it's better than nothing