Mac: Fix compile

This builds upon an incomplete fix in e954cc11e45667409dbc0c654596cff1adcd8010
which is not enough due to the way how the qmake dependencies on static libs
work.

Signed-off-by: Jan Kundrát <jkt@flaska.net>
Mark the files read-only when saving attachments for direct-open

This was suggested by Thomas Kluyver <thomas@kluyver.me.uk> on the xdg mailing
list.
Fix broken templates in the unit tests

At first I thought these were legit, but in fact this has always relied on
linker being "smarter" than required.

Reported by Antti Poikela <antti.poikela@iki.fi> (amppa on IRC) on, well, IRC.