Two-year fight to clear ‘attack’ dog ends in defeat