Downgrade open flags if we can't close the file.

A pinned cache entry's file can't be closed but if we don't need to open
the file in write mode anymore, reopen the file without the write mode.
Of course, this is possible only with fsals that support reopen method.

Currently if two processes open the file, one in read-only mode and the
other in read-write/write mode, the file is kept open in read-write mode
as long as either of them keep the file open. With this patch, the file
is downgraded to read-only mode when the second process closes the file.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>