Improve sample ruleset test.

Make it wait for a specific tab to be ready, rather than any tab, and close tab
when done.

cc @cooperq for code review.