Add to ErrorManager an recording limit

Add to ErrorManager an recording limit to avoid possible out-of-memory
errors in case of layout errors when dealing with large files.

After the threshold is reached, successive errors are ignored.