Print error-related messages to stderr.

This ensures that we only get JSON data when redirecting the output to a
file.