Bugfix for subnet deletion

Avoid foreign key failure from sqlalchemy by cascading the subnet
deletion.