Improve handling of subprocess shutdown on MS-Windows.