Escape % signs when creating an error object

Otherwise, the error message will end up corrupted if it contains
a % symbol because it's passed to fmt.Sprintf.