Fix some memory leaks
In a program I wrote, I had to plot a few hundreds of matplotlib plots, and memory usage went up to 5 Gb despite calling plt::clf() and plt::close() after each plot. Removing all instances of Py_INCREF seems to solve the issue, since Py_INCREF is not needed on return values of PyObject_GetAttrString and PyObject_Call, according to https://docs.python.org/3/extending/extending.html#ownership-rules.
I didn't intend to close this PR -- looks like something weird happened.
If you're compiling with g++, compile with address sanitizer ( -fsanitize=address and link against libasan), e.g. for examples/surface.cpp
g++ -g -Wall -fsanitize=address -o surface $(python-config --includes) surface.cpp $(python-config --ldflags --embed) -lasan
This will show you all memory leaks. Before your changes, and after.