Linux build: Fix library cleanup