add try-catch block for cross-script permissions

This commit adds a try-catch block to deal with the situation
in which opengamma is being called from another web page.  In
this situation, the cross-scripting permissions block access to
the parent window object, leading to the OG gui not rendering.