Fix potential crash in token handler

The C2DM module registers for its own `token` event, which receives `error` and `token` arguments -- it then tries to perform a regex on the token; however, if an error occurs and the token is null, then the regex will be performed on a null objec which will throw an exception, and since the exception is thrown asynchronously in an event handler, we bring down the host app.