rework filesystem locking for separate read/write flags
correct situation where files could be written when intended to be disabled