make dberr.Error thread-safe