ensure ndb write operations being properly finished