implement custom optimize
grrr camltc
fix test_db_optimize
unlink safely to avoid TOCTOU bugs
match () iso _
comments from PR
sync after optimize in same detached thread
Merge pull request #423 from Incubaid/custom-optimize

Custom optimize