Move the code from lib/util_sid.c that deals with the global_sam_sid into