Don't rely on implementation details of 'struct event'

- Use dynamic event allocation functions instead
- Remove deprecated header file
Compile as C89 with the Visual Studio 2010 compiler

- Also compile on Android, which lacks rand_r()
Pass event_base object into PubNub so that libevent usage is thread-safe in the face of other libevent usage in the same process
Fix crash when destroying PubNub context while a request is still pending when using libevent backend
Fix memory leak in error case
Add API for setting root CA certificates for SSL connections
Fix crash from double-freeing pointers in certain cases

If an HTTP call failed was retried due to the error retry settings, the HTTP callback data was freed when the first call failed, but the finished_cb_data held a dangling pointer onto that, so a crash occurred when the retry completed and that data was accessed and re-freed.