Fix invalid cast from long to int, causing a compare operation to always return FALSE.

This resulted in the main loop being indefinitely stuck into write() into a file descriptor.
Status Job ID Name Coverage
  External
failed jenkins

01:27:08

failed jenkins

01:30:37

failed jenkins

01:29:42

failed jenkins

00:37:40

failed jenkins

00:42:58

failed jenkins

01:24:23

failed jenkins

00:41:41

failed jenkins

00:41:13

failed jenkins

00:38:29

failed jenkins

00:18:08

failed jenkins

00:43:12

failed jenkins

01:25:23

failed jenkins

01:24:57

failed jenkins

01:24:46

failed jenkins

01:29:09

failed jenkins

02:02:36

failed jenkins

02:05:34

failed jenkins

01:24:43

failed jenkins

01:24:42

failed jenkins

02:05:43

failed jenkins

01:24:55

failed jenkins

02:05:27

failed jenkins

02:06:11

failed jenkins

02:05:04

failed jenkins

02:04:07

failed jenkins

01:17:51

failed jenkins

01:16:55

failed jenkins

01:17:54