idletime: fix potential divide-by-zero