I messed around to reproduce this and wrote a quick patch. This fixes it for me,...
[Patch] SDL2 throws out some input in relative mouse mode