[PATCH] python: Store pointers as c_void_p to keep references