fix kobo frozen when exiting koreader
This should fix #509.