Add a build that uses clang, scan-build and UBSan
Using clang here isn't very important, but it might give us some extra compiler warnings that gcc wouldn't.
Before merging this, I want to check that it detects the memory leaks that I just fixed.
Edited by Simon McVittie