Improve cached page-position heuristic.

Instead of caching the page position when the pen is simply down,
now it requires the pen both to be down and have a non-null style.
This allows absolute positions to be recomputed correctly after
a parent element is transformed when the turtle isn't drawing
(either because the pen is up or because the pen is null).

This commit also adds a test and fixes a test to be less flaky.