Israel's military says it is searching for a lone gunman who fatally shot two police officers outside an Israeli police station in Jerusalem before fleeing on foot.