client_api: fixes to version numbering stuff

Including not calling 16 bit quantities "nibbles".

In theory int can be less than 32 bits (although we certainly don't
support that in mpv), but using long here is still cleaner.
lua: rearrange timer handling in the event loop

Avoids having to call process_timers() in two places.