A while ago, I searched through the testing/test center policies found on mba.com for a definitive answer to this and had no luck.
Since then, a former student of mine inquired at a test center and was told by staff that if you have an answer selected when time runs out, that will be accepted as your answer even if you do not click to confirm. I may be overthinking this, but that seems reasonable because
(1) The system doesn't really require a "click to confirm" to enter the answer (after all, just selecting the bubble next to the answer would do that), but rather to tell the test (a)
give me another question or (b)
I am done with the final question, stop the clock early. If time runs out, you are automatically done and no next question will be given--therefore no need to confirm.
(2) If time runs out during the essay, the algorithm takes whatever you have written at the time. If that weren't so, there'd be an awful lot of people getting zeros instead of 4's and 5's because they were still typing at the very end.
However, if you can, try to manage your time so that you are able to finish with 30 seconds to spare. Better not to have to worry about it.