resty.core.shdict: updated the error handling code to reflect recent changes in ngx_lua.