Fix IndexError in parsing invalid date in the :mod:`email` module.