improving error message when livestatus socket not available, flake8 improvements