Avoid potential NullPointerException in ModulesPolicy getPermissions() and implies()

Issue is described in https://bugzilla.redhat.com/show_bug.cgi?id=1122580
Although I can not reproduce same error in EAP6 with IBM JDK6, it should avoid potential NullPointException as the return of CodeSource in ProtectionDomain may be null.