fixed concurrency bug in file.allocate()