[api] fix thread dead locks for real
[webui] switch capybara driver to poltergeist

This is the net result of 8 months watching capybara-webkit#494 not getting
fixed