Bugfixes in Multi-user Registry functions (in screensaver)

The screensaver thread does not share the global variables.  Therefore the registry functions were not working correctly there.  This patches fixes that and optimizes a couple of things as well.