Patches for segfault in check_mysql when checking slave (-S) [sf#2797757] [#989]