Fixes #844 #5725 - correct hosts count in puppetclass

`:dependent => :destroy` on a has-many through relationship causes the entry in the join table to be destroyed when deleting the relation, and fires the `:after_destroy` callback which doesn't fire by default (which is `:delete_all` - no callbacks fired). [See here](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Deleting+from+associations) for more details.