consider cast function arguments and return types during unification (fixed issue #1408) (fixed issue #1419)

git-svn-id: http://haxe.googlecode.com/svn/trunk@5952 f16182fa-f095-11de-8f43-4547254af6c6