Add appheader tests; fix buffer overflow in main_get_appheader

git-svn-id: http://xdelta.googlecode.com/svn/trunk@408 a3eca27d-f21b-0410-9b4a-6511e771f64e