Sorry if my question is misguided: did you try SQLite3's native online backup API? I would not use raw file access knowing they have that.
With time I have learned to speed-run less things because I've been bitten by the quick and dirty solution probably at least 100 times.