Former South Africa, Surrey and Somerset all-rounder Zander de Bruyn has announced his retirement from cricket.