As a test, if you go to Safari/History/Show All History, can you clear the history there?
Do a backup, preferably 2 backups on 2 separate drives.
Quit the application.
Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J. When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder. Select Library. Then go to Safari. Move the files that start with History to your desktop.
Restart the computer, open the application, and test. If it works okay, delete the files from the desktop.
If the application is the same, return the files to where you got it from, overwriting the newer one.
Thanks to leonie for some information contained in this.