Unwanted shut down of outputs.

On the laptop computer is an application that is "probing" serial ports on a regular schedule. Mobile phone / PDA applications are the usual culprit. When that application opens the Arduino's serial port, the Arduino resets. By leaving Serial Monitor running you are blocking that application from accessing the Arduino serial port.