test: code-style cleanup

Reworked win version of process_read_last_line() as suggested by Bert.

Squash this commit with previous ones in this pull-request.