This happens to me all the time. On my personal approach, I found that some of these tasks required my attention because, even when they were not as important or blocked the task that I had to do at all, I knew that if I didn't do them at the moment, I would forgot later, and that would result in a future problem.
So, what I did is tackle the "I forget" problem. I started writing them down as future tasks in my task tracking system, but that somehow wasn't quick enough to allow my flow to continue without distracting me.
So I bought some regular post-its, and when I come to one of this tasks, a quick writing on them (it's only for me), pin them to the wall, and move on. It sounds weird, but having the task written down on paper makes me feel more "accomplished" about not forgetting about it, and having it on the wall looking at me, hunting me down, gives me motivation to get rid of it later.