properly close and terminate git log subprocess