Fix NPE when PDF is opened in InAppBrowser.
Refactor User-Agent logic into a helper class.
Fix for CB-2225

This uses a work-around with caveats :( to prevent the User-Agent from
being changed when the InAppBrowser loads a PDF.

This also adds a User-Agent getter to CDVCommandDelegate.