Turns out this only reproduces if the tab you want to drag is one which would require your master password. The other background tabs are not impacted. So, the mousedown that starts the drag also serves to bring the tab to the foreground and trigger the master password prompt to show.
I suspect we don't want to change the mouse-down-brings-background-tab-to-foreground behavior.
Detecting a tab drag is a little tricky - we don't currently keep any state that would say "this tab is in the process of being dragged". Technically, any mousedown on the tab starts a drag, we just abort handling it if the distance moved was below some threshold. However, finding a way to wait for the drag to end or mouseup to happen before processing the _onVisibleTasksByDocument in LoginManagerContent.jsm is one potential direction to take.