Add io_service::work to prevent listener thread terminate. Also reset io service before submitting query