This patch updates several CodeQL errors for potential null pointer access and unguarded header conclusion across production and test code that have been flagged in the build/security tab in GitHub. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>