Fix timestamp comparator return value

Same thing as in #11471, but for the timestamp comparator. Until now, the comparator doesn't do what its documentation says (return either -1 or 1). Instead, it subtracts the second timestamp from the first one and returns the result.
To stay consistent and to avoid integer overflow problems for large timestamp differences (in the future), this should be changed.