libsocialweb tests: disconnect all signals

Patch by Simon McVittie
Eds.Backend: use a safe remove-while-iterating pattern

Otherwise, if we unprepare with more than 0 address books, we'll remove
from a hash map while iterating over it, resulting in a crash.