make sure we only call EM.add_shutdown_hook if client is EM