fix memory leaks in pytensor constructor and copy constructor
fix memory leaks in pytensor constructor and copy constructor

xtensor-stack/xtensor-python,xtensor-stack/xtensor-python,QuantStack/xtensor-python,QuantStack/xtensor-python