How to prevent or notice automatic connection retry in SQL Server and OLE DB
You can check if the temporary object exists using this:

IF OBJECT_ID('tempdb..#sometablename') IS NULL
    CREATE TABLE #sometablename ...


Another thing you could do is check the connection time for the current connection:

SELECT connect_time
FROM sys.dm_exec_connections
WHERE session_id = @@SPID


However, I'm having a hard time believing that the client disconnects without throwing errors. I would try to catch those errors first.