Gunmen attacked a police guard post outside the U.S. consulate in Istanbul Wednesday, local authorities said, and at least three Turkish police officers and three of the attackers were killed in the ensuing gun battle.