As a show about cabaret culture opens at the Barbican, it’s worth remembering that nightclubs are about more than just a good time