Use exclusive lock on session write.
Put lock flag on filesystem class.
Merge branch '4.2'