Officials said the firearm discharged as Louis Lester Anderson was adjusting his waistband after buying coffee and a bagel at the upscale Manhattan market.