Fix data race caused by open_fd_count

Access open_fd_count through a set of abstract interface.  As it abstracts
open_fd_count way, it also helps replace open_fd_count (a temporary solution
according to the comments) with something better in the future.

Signed-off-by: Ming Chen <v.mingchen@gmail.com>