Police officer frantically texted family goodbye while being hunted down by gunmen