Disallow appended newlines when parsing as integer

\Z allows appended newlines where \z does not.
Merge pull request #17148 from mgenereu/patch-1

Disallow appended newlines when parsing as integer