Fixes file descriptor leak in standalone mode. Prevents simultaneous calls to updatestat() as function is not reentrant.
Fixes file descriptor leak in standalone mode.
Prevents simultaneous calls to updatestat() as function is not reentrant.

PR:		bin/24857
Submitted by:	Martin Butkus <mb@bagheera.thgwf.de>
MFC after:	1 month

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase