Student can't start new attempt if a quiz has timle limit between attempts and time limit for a quiz, and he doesn't submit previous attempt closing browser window instead.
After chat with Tim proposed solution is to add a check
&& $timenow - $quiz->delay1 - $quiz->timelimit < $lastattempt_obj->timestart
to the $timenow - $quiz->delay1 < $lastattempt when displaying error trying to start attempt.
We may need to additionaly check of $quiz->timelimit>0 to retain current behavour for not timed-out quizzes. There should be patch for both attempt start and displaying a button to do this.
Patch for 1.9 will be submitted for people who want to use it, for 2.0 it meant to go to the core.