added parameter to mqtt loop to return immediately and add a forced 1 second sleep.