Fix timestamp counter on s390/s390x

Fixes #811 and test failures on s390/s390x.