Rework handling of return values in thread tests Pass a struct to each thread that contains the filename and the return value. This avoids casting a DWORD to a pointer on Windows.