Bug fixes

Fix weird issue of calling bufferevent_free from within callback.
Fix OpenSSL specific shutdown issues.
Fix several SIGSEGVs including #11