This should prevent bans database from resetting with a "function has more than 65536 constants" error. Older databases should still be loaded correctly. Also makes use of minetest.safe_file_write to avoid data corruption.
Requested by ShadowNinja.