fixes #6126 - deleting a subnet that is associated with a host group throws foreign key error

nitpick, just changed order, I usually prefer the :through join first.