Set Global cache at beginStream time for Stream modules

Bug fix: originally the setGlobal wasn’t done until beginRun. However, if there was an exception between beginStream and beginRun time, the endStream method of the stream module would be called and if globalCache() is called, it would be given a nullptr.