[bugfix] Avoid NPE when getting the real user identity in an XQuery Module

Fixes #388 and fixes #252