Make exceeding MAXWRITE a fatal error.

Instead of spinning for a while, exit immediately.
Allow setting limit constants during compilation

Use the MAXLOOPS and/or MAXWRITE environment variables to set the
constants at compile time.