An American woman, her Canadian husband and their three children have been freed from captivity by Pakistani security forces, nearly five years after being taken hostage by the Taliban.