Reads up to n characters from the serial input buffer and returns them as a string, along with a digit indicating whether errors occurred.