Fix two memory leaks in function align_program in py_state.c