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