PerlIO_find_layer should not be using memEQ() off the end of the layer name.

PerlIO_find_layer was using memEQ() to compare the name of the desired layer
with each layer in the array of known layers. However, it was always using
the length of the desired layer for the comparison, whatever the length of
the name it was comparing it with, resulting in out-of-bounds reads.
In S_scan_heredoc(), the explicit test for '\n' duplicates the strNE().

PL_tokenbuf always starts with '\n', so a separate test of *s against '\n'
is duplicate work. Hence remove it, to make the code simpler and clearer.
In In S_scan_heredoc(), avoid memNE() reading beyond the end of s.

If the heredoc terminator we are searching for is longer than the bytes
remaining in s, then the memNE() would read beyond initialised memory.
Hence change the loop bounds to avoid this case, and change the failure case
below to reflect the revised end-of-loop condition.

It doesn't matter that the loop no longer increments shared->herelines,
because the failure case calls S_missingterm(), which croaks.