fix crash on shutdown of interface

fixes #1671