Fix number_of_ticks
This is an API breaking change. The number_of_ticks is akin to keep_up_to_date with bars: it will first flush with whatever is in the cache. It will return more or less than number of ticks.
We also return a rust timestamp instead of i64.