msg_queue: strncat() securing, and add some debug prints.