Fix close call

Put setTimeout call in a closure so it fixes the following: 
On Firefox 29: TypeError: 'close' called on an object that does not implement interface Notification.
On Chrome 33: Uncaught TypeError: Illegal invocation.