Fix pickling regression with __getstate__()