COMPAT: Fix py3 caching for get_rdatasets.

This is against master. I'm assuming there aren't any problems cherry-picking this to the maintenance/0.5.x branch, but if this is undesirable I can make the commit against it.