clean update devicestate function, ensure that it can return AST_DEVICE_UNKNOWN when...