Fixed issues with sync to tmp area for a readonly user when WAL mode on'