It is assumed throughout the code that the whole promise type is non-reentrant. We have several other function calls that suffer from the same problem. In fact, adding multithreaded evaluation to cf-agent will be incredibly difficult in general, because we call many non-reentrant POSIX functions, and even a sizable portion of our own functions are non-reentrant (``CommandArg0`` is one example).

Add to the mix that some functions don't have reentrant versions: ``getgrent`` has ``getgrent_r``, which apparently was a failed attempt at making it reentrant, since it also isn't. Could all be solved by locking and copying, of course, but not useful unless we want cf-agent to be multithreaded (not a good idea, IMHO).

While writing this I realized that we need to make the same fix for ``getgr*`` functions though. See comment in https://dev.cfengine.com/issues/5721.