readpin: only calculate the static part of the sleep period once.
input.c: like in readpin, only calculate the static part of the sleep period once.

This gains some 6 Hz on a non-optimized built with clang 3.3 on a standard Raspberry Pi.