Fix CURAND Wrapper in Python 3

Python 3's capsule API and the corresponding NpyCapsule compat. wrapper changes the signature and behavior of the C object destructor.

This properly fixes the failed test in #1413.

Also added a commit to fix #1421.