CertPath: output PkiPath in correct order

All PkiPath encodings were coming out backwards from the
specification since the PkiPath is encoded in the opposite sequence of
the documented API convention in code.

Clean up the code to match current convention.

Remove encoding optimization that could cause a race since the cached
encoding fields are not final and the supplied encoding may not match
re-encoding.

Change-Id: I17db0e52272a1adf47766c8bbd33b63da454c1cf
2 files changed