Bug 800915 - Clarify and refine the semantics of SecurityWrapper so that it is used if and only if unwrapping is unsafe (on esr17). r=Ms2ger a=bajaj

This is a very tricky backport, because there's are various changes which make
the patch not apply directly. Specifically:

1 - ESR17 Still has DOMProxy Xrays, which didn't exist for the original patch.
2 - ESR17 doesn't have the Xray refactoring from bug 761695, which means that we
    have to do explicitly set usingXray = true whenever we select an XPWN Xray.
3 - ESR17 still has the DirectWrapper/IndirectWrapper crap.

Commit message of the original patch:

The naming scheme for Xray typedefs is the concatenation of the tuple:
({SC,}, {Security,Permissive}, Xray, {XPCWN,DOM}). This is admittedly a bit
much, but I think it's still better than explicitly doing the "typdef Foo Xray"
everywhere. Moreover, once the new DOM bindings are done, the last component
in the tuple will go away.
Bug 800915 - Add infrastructure to flag security wrappers as unsafe to unwrap (on esr17). r=Ms2ger a=bajaj