[py] incref exception type before restoring it