Merge "[Thread] convert OT_ERROR_INVALID_STATE to INTERNAL_ERROR" into main