Copy messages array to prevent concurrent modification exception

Fixes #12 by copying the log messages array.