use eventloop to finish closing AIO files instead of doing everything from a
separate thread
additional thread safety
try to fix compile
attempt to fix build