logic-jitter.py: fix an issue in the main loop

We can compute the delay directly after we have read the GPIO value.
By doing that we fix a bug where we loose line in the csv.

Fixes #2