Fixes #167: Check if driver is unloaded when freeing array