Add leak checking for definite leaks to 'make check-memory'

Closes #960