Try harder to avoid err being undefined in resultsdb_report
Seems Python has a kind of odd behaviour where when you assign
err in an except block clause like this it actually gets deleted
deleted once we leave the except block, even when it was declared
at a wider scope earlier (as here). This solves that problem by
using a temporary variable to assign the exception to.
Signed-off-by: Adam Williamson <awilliam@redhat.com>