Make Context class a Python context manager
This makes the Context class a Python context manager to allow reliable cleanup on process termination and in tests. This will be used in the casd branch (#1042) to terminate the buildbox-casd child process. It might also be useful to reset _yaml.pyx state (#1070).
The diffstat is relatively large, however, most changes are indentation changes. It's thus advisable to mainly ignore whitespace changes when reviewing this.