Upgrade consul to 0.4.0

Closes #6027.