Shorten the critical section in filemgr_write_offset()
Shorten the critical section in filemgr_write_offset()

- Since block cache is protected by its own lock, we don't need to
grab lock if the block hits the cache.

- And also we don't need to grab lock for a block that is being
written first time, because it is not reachable by any other indexes
at that time.

- This patch reduces the overhead from grabbing lock.

Change-Id: I7fdf29ed4b6480d19f4351177d08bca21125085b

couchbase/forestdb,nvoron23/forestdb,seem-sky/forestdb,joliss/forestdb,zhaog/forestdb,sushmaad/forestdb,seem-sky/forestdb,zhaog/forestdb,yyangpan/forestdb,hisundar/forestdb,nvoron23/forestdb,joliss/forestdb,wurikiji/forestdb,sushmaad/forestdb,hisundar/forestdb,jinxuan/forestdb,jinxuan/forestdb,couchbase/forestdb,wurikiji/forestdb,yyangpan/forestdb