added timeout to ping function

help alleviate issues where socket is open but unresponsive and ends up
blocking the entire webui