Pakistan's army says it has freed a Western family held hostage by the Afghan Taliban for five years.