@Mathias I'm probably one of those people sometimes... I'm not great at picking up social cues that you don't want to talk.
maybe try being a little direct like: wow I appreciate this talk we are having, but I need to put my attention back on the task at hand.
the above would in no way upset me, because I know I can talk an ear off when the mood strikes.