Engine: do not close pid until source is removed

"Note that on platforms where GPid must be explicitly closed (see
g_spawn_close_pid()) pid must not be closed while the source is still
active."

See 6ed120deb43069cb8ae9ef81ac99ac390b523b96 but do it right this time.

It really doesn't matter because this is Windows-only, and GNOME Chess
does not run on Windows, but it's nice to be correct.