Fix potential race-condition in reference scanning code
Fix potential race-condition in reference scanning code

Previously the code ensures that the isBase32 array would only be
initialised once in a single-threaded context. If two threads happen to
call the function before the initialisation was completed both of them
would have completed the initialization step. This allowed for a
race-condition where one thread might be done with the initialization
but the other thread sets all the fields to false again. For a brief
moment the base32 detection would then produce false-negatives.

rycee/nix,NixOS/nix,rycee/nix,NixOS/nix,rycee/nix,NixOS/nix,rycee/nix,rycee/nix,NixOS/nix,NixOS/nix