lua: do *not* truncate cache size to unsigned

... and perform extra checks when converting from the floating-point
number.
3 jobs for cache-size-overflow
in 1 minute and 7 seconds and was queued for 3 seconds