fixup gui2 unit tests

The file test_gui2.cpp was causing segfaults in the debug build,
gfgtdf spotted the cause: a function was returning references to
local variables. It was most likely a minor oversight, as many
similar functions nearby made these variables static. This commit
makes those local variables static and appears to fix the crash.

Relevant irc chat: http://www.wesnoth.org/irclogs/2014/05/%23wesnoth-dev.2014-05-13.log