Cherry-pick "Bug 741810 - Compilation fails because of creating .gnucash"

This was meant to go on maint first...