Fixed file locking bug in windows (even though i do not support windows ;). This is a real PITA as windows does not release resources correctly (in the correct order) There is a windows PHP bug that means due to resource not being freed up in time, rename would error with access denied.

The result of this is loss of save data or persistant locked db file.

This fix uses a temp (~) db file to do two things. Stop us having to use rename, we now delete and copy fresh changes, anyone reading/writing at the time of deletion is served a backup (~) file. We also get a data backup which is handy for future auto fixes.

Also tweaked db engine to be more efficient with multi writes in single pass. All gravy ;)