Revert "Revert "Merge pull request #283 from matrix-org/erikj/atomic_join_federation""
Revert "Revert "Merge pull request #283 from matrix-org/erikj/atomic_join_federation""

This reverts commit 34d26d36874ab0bc7fa4dab0db08bd37ba4936ae.

iot-factory/synapse,iot-factory/synapse,matrix-org/synapse,TribeMedia/synapse,matrix-org/synapse,iot-factory/synapse,matrix-org/synapse,iot-factory/synapse,TribeMedia/synapse,matrix-org/synapse,TribeMedia/synapse,matrix-org/synapse,TribeMedia/synapse,iot-factory/synapse,matrix-org/synapse,TribeMedia/synapse