The troll doesn't always stay on screen for the same amount of time. He might leave sooner the next time you play. I recommend using the lid to defending against the troll at least until you unlock its upgrade.
Also don't let the flies attack the lid if you want to keep it safe.