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

@ohadlevy, is this also true in the opposite direction to not delete a subnet if there are associated domains?