Sync test: wait for XML-RPC server thread to finish

(now that it actually *does* finish when we want it to)
Mock sync server: fix API of get_new_hosts

Match the data type/structure used in Sync.receive_new_hosts.
Expand basic Sync test
Add SyncTestSendHosts