Native will get destroyed before the Java HTTPRequest and asynchronous
requests might still get answered.
If the request gets canceled, we now clear the reference to the native
code and it will never reach it.
Lock is needed because OkHTTP replies on its own thread, so we need to
guard the access to the variable we use for checking if the Request was
canceled. In the future we could remove the lock and use Runnable when
we move Android main loop to Looper instead of libuv.
Like the other implementations of HTTPRequest on Mapbox GL Native, the
request is destroyed synchronously on ::cancel().
There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.