minor code cleanup
clean up some test code and apply some safety fixes
safety fix
apply some safety fixes in test code
remove redundant code from cygdb test and apply some safety fixes
simplify cygdb test code to remove an unnecessary indentation level
close output file ASAP
when includes are used, additionally generate one annotation file per included file

--HG--
extra : amend_source : c2b02f8beedd17cdae81256283c30de6f5767e08
add safety check for now to avoid trying to write annotation files into standard include directories etc.