Call endSheet in the main thread. (resolves #6)