A man who shot five people dead at a Bangkok food market "had a personal grudge" against security guards there who he believed scratched his car.