Fix: remote: Correctly calculate the remaining timeouts when receiving messages
Previously due to the incorrectly calculated timeouts, incomplete messages could be received and handled when it was not supposed to time out.