An Egyptian court has acquitted Ahmed Shafiq, a former prime minister and presidential candidate, and two sons of ousted dictator Hosni Mubarak, of corruption charges.