Update messages array in main thread.