Calling Message.tags_to_maildir_flags() when the database has been opened
with a relative path results in a corrupted filename entry in the database.
The actual filename is changed properly but the filename in the database gets
the relative path prepended.

As I understand it's expected that the database path should be absolute but corrupting the database when the path is relative sounds dangerous.

Attached is a python script showing the problem.
Run it as follows:

   python ./retag_bug.py db_path +tag,-tag search_query

Also attached is the output showing the problem.