only the first change_status handler gets called on quit
in on_quit_request in src/roster_window.py, a counter variable (quit_on_next_offline) gets set which should quit gajim when all accounts are disconnected. Due to the currect design, always leads to quitting after the first account disconnected, because the variable gets incremented for one account, and immediatly afterwards the account gets disconnected, which leads to the variable being decremented:
for acct in accounts:
if gajim.connections[acct].connected:
self.quit_on_next_offline += 1
self.send_status(acct, 'offline', message)
Still in send_status() (to be more specific, in the connection's change_status() method), the STATUS handler is called, which in turn calls the roster_window's on_status_change, which reads the variable mentioned above, and quits gajim when it's less than 1.
To make this work, you should first increment the variable for all accounts, then disconnect them.
A patch is attached.