python: Release Python GIL where appropriate (RhBug: 997042)