Proposed unit test and fix for issues raised in #599 and #600.

Pro for the test:
* Successfully tests issue #599 across multiple platforms.

Con against the test:
* It can take a long time to run (7s on my netbook); it uses a sub-process for several values of PYTHONHASHSEED.

Hopefully I can keep hacking on this to get a fix in as well.
I really prefer assertEqual, since it gives you a meaningful error message (rather than the unhelpful "AssertionError: False is not true").