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.