job_submit/lua for error memory reference

Fix invalid memory reference if script returns error message
for user. Previous code failed to set static variable to NULL
resulting in xfree of memory previously freed elsewhere.