[Python.NET] Several patches to improve compilation with Mono