pp.c: Guard against malformed UTF-8 input in ord()

This code got the actual length of the input scalar, but discarded it.
If that scalar contains malformed UTF-8 that has fewer bytes than is
indicated, a read beyond-buffer-end could happen.  Simply use the actual
length.
pp.c: Remove unnecessary mask operation.

An unsigned character (U8) should not have more than 8 bits of data, so
no need to force that by masking with 0xFF.
regexec.c: Guard against malformed UTF-8 in [...]

The code that handles bracketed character classes assumed that the
string being matched against did not have the too-short malformation;
this could lead to reading beyond-the-end-of-buffer.  (It did check for
other malformations.)  This is solved by changing the function that
operates on bracketed character classes to take and use an extra
parameter, the actaul buffer end.
regexec.c: Clarify comment