Adapting flowspace on link up/down

This works but it isn't the greatest thing ever. There are uncaught
exceptions upon deleting flows on switches that aren't in flowspace
anymore, because we don't know what port on the switch _used to be_
connected to the other switch (since that link is no longer in
network_graph). What we really need to do is either keep state in
the controller of flows we've installed, or set flow expiry to a
shortish time and refresh flows periodically.

The first solution could be implemented by a switch being stored in
the network_graph as a Switch class instead of a plain integer dpid.
This class would have a list of ofp_flow_mods or just simple tuples
with (inport, invlan, outvlan, outport).

The second solution, if we do it correctly, would involve spinning
off a new thread that is responsible for all operations on switch
flow tables. The current way we do this just seems very ripe for
race conditions and thread safety issues, since the methods calling
install_flows are as diverse as:

 * _handle_openflow_discovery_LinkEvent
 * establish_connection
 * disestablish_connection

 In turn, (dis)?establish_connection are called by either an event
 (handle_rcp_msg) or at the pox console. Async events directly
 messing with flow tables are probably bad.

 Therefore, the second solution will probably be the one that gets
 implemented.

 Also, there are plenty of exceptions upon shutting the controller
 down. This controller needs a graceful shutdown method.