Merge "hal: avoid echo reference is disabled when closing input stream"