An Egyptian police officer was killed after two militants opened fire on a security outpost near the Suez Canal.