leaks: Allow user to set the flags to use to retrieve stack traces