Prevent buffer overflow

If the serial is configured incorrectly, it's possible for more bytes to be available than the buffer holds. This prevents the overflow.