Officer quits to avoid firing after shooting of unarmed teen