Support for Lua 5.2

Tested with 5.1.4 and 5.2.3

This was intended to fix #9805, but that has resolved itself. However Lua 5.2 was released 16 Dec 2011, so it's time to support it.

It fixes a potential bug when strings from Lua where given as C-string to `add_msg` and `popup` - both function perform string formatting a bad things happen when the string from Lua contained format specifiers.