Fix iOS popup issue #56 by wrapping popup.close in setTimeout