Venezuela's Supreme Court has been attacked with a grenade thrown from a police helicopter in what the country's president, Nicolas Maduro, described as a "terrorist attack".