Fixed bug introduced in the previous commit - the lock must be held until after the call to exec_check_permissions().
Fixed bug introduced in the previous commit - the lock must be held until
after the call to exec_check_permissions().

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