Craig Greenberg beats out crowded field, promises to improve city safety, months after social justice activist opened fire at him but narrowly missed