OF-1856: Fix isAnonymous detection
The isAnonymous check should not depend on the fact that the provided JID is a full JID. This will give incorrect results ('not anonymous') if the provided JID is bare.
This commit checks for any anonymous session that matches the bare JID - if there's one then that's enough (a user cannot be both anonymous and not anonymous).
OF-1854: Allow trust- and identitystores to be of different type.
This primarily facilitates integrating with Windows certificate stores, by setting the type of 'Windows-ROOT' for truststores, and 'Windows-MY' for identity stores.