DNN-6240: fix for Violation of PRIMARY KEY constraint 'PK_dnn_Exceptions'

The fix contains a performance improvement as well: using BASE64 for byte conversion instead of iterating and concatenating HEX formatted values to a string.