Fix NSNotificationCenter and NSTimer leaks

* Remove keyboard notifications from NSNotificationCenter.
* Invalidate NSTimer instance of the main loop.