Fixed segfaults caused during joblib dump/load by missing __getstate__ and __setstate__.