All eight people stranded in a cable car hundreds of metres above a ravine in Pakistan have been brought to safety in a dramatic rescue.