Improve handling exceptions

- improve openflow version negotiation
- use fd instead of id()