Ministers have been warned against “robbing Peter to pay Paul” after the director of MI5 said that the intelligence agency had been forced to “pare back” its focus on countering terrorism