[Bluetooth][Non-ACR] Add NULL check logic for Marshal.PtrToStringAnsi (#1658)