Add a build option for sanitizer.

This request relates to #835.