To make sure that there is no concurrent operation on the datastore file. Fixes #1132
in order to keep index.php as minimal as possible