Cache connections in GCM and C2DM gateways per thread

Instead of caching the connections in the C2DM and GCM gateways in
instance variables, we use the thread local storage provided by
`Thread.current`.

The reason for that is thread safety, since gateway objects are
practically singleton objects that can be used by multiple threads at
the same time.

With this change each thread that calls `deliver` on a gateway gets a
fresh connection object and doesn't interfer with the other threads'
state.