South Africa's George Linde was denied a hat-trick after an overturn by DRS for lbw against Pakistan.