A militant attacked a security patrol in Lebanon’s northern city of Tripoli on Monday night, killing two police officers and two soldiers before blowing himself up, officials said.