ospfd: 'ip ospf network' interface should down iface before changing type

* ospf_vty.c: (ip_ospf_network) This function changes the interface type
  and only then downs/ups the interface if already up.  So the down happens
  with the interface type already altered.  However, the interface type
  can have major ramifications for how underlying state is stored/indexed,
  which may cause problems.

  Further, bit of an encapsulation violation to twiddle state here.
  (no_ip_ospf_network) ditto.
* ospf_interface.c: (ospf_if_reset_type) New function to reset the OSPF
  interface type on an interface. Ensure the interface is downed before
  the type is changed.
* ospf_interface.h: (ospf_if_reset_type) Export, for ospf_vty.c
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h
index 69b9b40..7070353 100644
--- a/ospfd/ospf_interface.h
+++ b/ospfd/ospf_interface.h
@@ -276,6 +276,7 @@
 extern void ospf_if_stream_set (struct ospf_interface *);
 extern void ospf_if_stream_unset (struct ospf_interface *);
 extern void ospf_if_reset_variables (struct ospf_interface *);
+extern void ospf_if_reset_type (struct interface *, u_char type);
 extern int ospf_if_is_enable (struct ospf_interface *);
 extern int ospf_if_get_output_cost (struct ospf_interface *);
 extern void ospf_if_recalculate_output_cost (struct interface *);