Is there a way to work-around this?
Send heartbeat messages. This means you define some command in your protocol that does nothing except resetting a timer. If the timer reaches some configured value your connection is dead and can be closed.
Broken connections are always detected that way because if you switch off your laptop (not by software but by disconnecting power and battery) your connection will stay alive too because no packet with FIN bit is sent.