Prevent hiredis from crashing on memory allocation failure

Updated redisConnect functions to make them check that the context is properly allocated (i.e.: non-NULL) before attempting to dereference it. These functions can therefore return NULL to the callers in such cases.

Updated documentation and examples accordingly.