Another thing you can try: use the command line version of restore. This method ensures that no part of calibre (content server, etc) can accidentally have the replacement DB open.
The documentation is at
http://manual.calibre-ebook.com/cli/...store-database.
A quick synopsis, assuming that the correct library is chosen when you start calibre. If you are using calibre portable or if you are using environment variables, the following won't work. It also probably won't help if the problem is caused by some program other than calibre (e.g., an antivirus program or something else) holding the database open, although it might because the timing is very different.
1) open a command box. One way to do this is Start -> Run. Type cmd and press return.
2) type "calibredb restore_database --really-do-it" (without the quotes).
3) watch the messages go by while you wait ...