fix var name typo in writeJSONError, save silly <nil> log

this particular method actually takes an error variable as an argument,
making it easy to confuse the input "err" variable with what is normally
used as a local variable name that captures errors from method calls.
Precisely this happened - a different variable name had to be used to
capture the error from the call to json.Encoder.Encode, but the
conditional still checked if "err" was nil; of course, it wasn't, since
the whole point of this method is to process an error condition, but the
log call still used the "jsonErr" variable. As a result, every call to
writeJSONError resulted in a "<nil>" log line - in most cases, Encode
does not produce an actual error.