Search for %%EOF in the last 1024 bytes

With full Py3 compatibility.

See also: https://github.com/mstamy2/PyPDF2/issues/34