Better support for BRANCH_SAMPLE_STACK

print the flag values
try to validate a bit
fall back to not using BRANCH_SAMPLE_STACK if not available