Here's how to recognize whether your dog may have tapeworms, how to treat the condition, and how to prevent it from recurring.