Pakistan, Afghanistan vow to jointly defeat terrorism