scratchpad: Protect against null prevPen

Fixes #71379.

Test Plan: Click down in the top area of the scratchpad next to the colors, then drag down into the actual drawing area. No JS errors should result.

Auditors: alex