Add handler for hiding the error messages while navigating away

Fixes #272
Merge pull request #324 from flowplayer/bug/272

Add handler for hiding the error messages while navigating away