Officer fatally shot suspect in stabbing