Add missing with_statement imports (issue 3751)