Wrap body of parse() in try-catch block to avoid unhandled exceptions

We've encountered user agent strings before that have caused exceptions within the platform code. Wrapping the parsing logic with a try-catch block seems to be the best way forward. That way a `platform.parse()`call for such an unexpected user agent string would return `null` rather than breaking the code.

(The Github diff for this comparison is deceptive, because it takes white-spaces into account. Adding `?w=true` to the diff URL will ignore all white-space changes.)