Why do dihaloalkanes lose both halogen atoms during mass spectrometry?
It isn't just both bromine atoms that are lost, although that might be expected in mass spec given the relative weakness of the carbon-bromine bond.  You also lose a hydrogen atom.  And that is key.
We might suppose that a single bromide ion (or bromine atom plus electron) comes off first, forming a $\ce{C4H8Br^+}$ ion.  That is the peaks at 135 and 137, recalling that in mass spec the mass of a bromine atom is both 79 and 81 which are the most common isotopes.  There is nothing spectacular about such an ion per se, but now it can eliminate $\ce{HBr}$, or $\ce{H + Br}$ to give a resonance-stabilized cation:
$\ce{CH2=CH - \overset{+}{C}H - CH3}\leftrightarrow\ce{\overset{+}{C}H2 - CH=CH - CH3}$
Thus the formation of this ion is energetically favored, and it would account for $\ce{C4H7^+}$.
In the case of 1,4-dibromobutane you should expect the initial (primary) $\ce{C4H8Br^+}$ carbocation to rearrange with a hydride transfer to the end carbon that first lost the bromine, making the ion secondary.  Then the ion will match that obtained with the other isomers.