Fix undefined behaviour when printing the X509 serial