This fixes #7459.  It now locks the device so it can't be polled, or have the config read while it is being programmed.