tests: pingpong - send bye, finalize if error

In check_return(), if we are about to exit, notify the peer and call finalize()