fix test_restart_master_long with better error handling