Scaler code bugfixes from Bob Michaels.

Fixes: Clock rate calculation bug, missing VME timeout, and 64-bit
incompatibility in database code

Modified by me to preserve binary compatibility.
Version is 1.5.26