How to make Safari warn me with a pop-up window before closing a tab?
Instead of using your mouse you can use the keyboard to cycle through the tabs. The keys Ctrl+Tab will go forward through your ten tabs and Ctrl+Shift+Tab will go backward. At no time will these key commands close a tab by mistake.

Should you want to close a tab however you can achieve this with Command+W. Once you've finished using your browser you can close it with Command+Q.

Edit: Further to my answer in the latest version of Safari you have the ability to pin tabs. Once a tab is pinned the only way to close it is to right click it with the mouse and select "close tab" Even the Command + W keyboard combination won't close it.