fixed bug at end of experiment

When last row of procedure was reached, the trial type was searched for, even though it was the EndOfExperiment line.  This was creating a small warning, which was preventing the redirect if buffering wasn't enabled.  So, I moved the opening of the buffer before that point.
Merge pull request #47 from TysonKerr/bugfix

fixed bug at end of experiment