Detection of terrestrial gamma-ray flashes with the AGILE satellite