Fix warn_report and error_report macros.
Originally they didn't check err.kind(), since err.kind() can never increase their severity. We lost that behavior with !1386 (merged), and we became dependent on it with !1383 (merged). Since they both merged at the same time, CI broke.
This patch restores their original behavior.