Safari – Merge All Windows
https://www.youtube.com/watch?v=SaIdShQemy4
Or you can drag the app divider left or right over the Safari window that you want to close. You can also merge your Safari windows into one: touch and hold the windows button or the add button in the toolbar, then tap Merge All Windows.