Optimize update_thread_counters() / update_thread_data()

- merge both functions into one, but retain backward compatibility
- save two DB queries
- reliable replies counter supplied by existing DB query

see also:

- http://community.mybb.com/thread-100243.html
- http://community.mybb.com/thread-100243-post-954520.html#pid954520
- http://community.mybb.com/thread-100243-post-955425.html#pid955425