medium: ui_context: Correctly check end_game() return value (bnc#868533)