fixes bug 1042718 - error on json_dump without 'threads' key
Merge pull request #2239 from peterbe/bug-1042718-internal-server-error-on-json_dump-with-threads-key

fixes bug 1042718 - error on json_dump without 'threads' key