Refactor frame_counter.

Graphics drivers get the task of updating this.
If threaded driver is used, main thread cannot update the counter
due to race conditions.
Fix threaded driver.

Fix case when no poke interface was implemented.