Update Package.php

As per discussion on your blog.

The change creates session variable that stores the state of the code and prevents the code from executing more than once per session. It also prevents known issue with Varnish integration.