The city of Los Angeles will pay more than $21 million to settle claims by people who lived in a neighborhood where police bungled the detonation of illegal fireworks three years ago, injuring 17 people and displacing many others.