Dogs can sniff out bacteria that is a major of cause of lung damage in people with cystic fibrosis before it takes hold, according to a study.