Cleaner attempt to fix #827
More work on #827: restricting to OP_CALL and adding adjoint case
More work on #827: removed now-unneeded code
Merge pull request #872 from casadi/ticket_827_b

Fixing #827: superfluous calls in derivatives