Added tests for loot_get_plugin_messages.
Fixed loot_get_plugin_messages bugs.

Bugs fixed:
* Non-null message pointer outputted when no messages are present.
* Plugins with multiple messages output structures that point to
uninitialised memory.