Use try..finally in once

The listener should be removed even if the listener has thrown an exception.