Use a blocking line-oriented messages rather

The old way used a non-blocking read of all available bytes and hoped they were all there. Not exactly super-stable.
Add information about the purpose of parameters
Add high-level protocol description and notes about PID passing
Send NUL-terminated PID to clients per the new protocol
Remove ugly window-raising hack
Add ffi definition for GetCurrentProcessId
Raise the window with SetForegroundWindow on deiconify
Add listbox-select function
Add tk-write-byte function
Fix var name
Recompute the image preview on finish
Simulate pressing "Done" when closing the window