Change some implicit conversions to return const references to objects...

...instead of temporary objects.

Fixes bug #20360.
Merge branch '1.10' of github.com:wesnoth/wesnoth-old into 1.10