Fix a segfault in MessageClient::write() due to wrong usage of writeArrayMessage()