Fix unused variable warning if assertions are disabled

as we're using -Werror, this actually breaks the build
Merge pull request #1469 from diederich/fix/error-with-disabled-assertions

Fix unused variable warning if assertions are disabled