PythonGlue: make a copy of the input filename to ensure exclusive access

Otherwise someone may change the contents of the py_input_data object
which could lead to undefined behaviour of the Flight class.
PythonGlue: fix possible memory leak in xcsoar_encode
PythonGlue: fix double free caused by a incorrect DECREF