Strip leading whitespace before checking if a statement looks like a declaration (fixes #9914)