Rearranging how threading works.

Setting the isScanComplete flag directly when the serialCommunications method that waits for data receives data from the hardware.