Initialised relevant variables before stating thread, to prevent a branch on uninitialised data. Fixed race condition in polling that could miss a device change. (cherry picked from commit fe4265ad46)
fe4265ad46