fix: to_datetime returns KeyError: 'p' when %p specified in format string (GH5361)

closes https://github.com/pydata/pandas/issues/5361