Fixed recursively calling blocks in templates with inheritance

Replaces #1321 
Fixes KnpLabs/KnpMenu#136 and KnpLabs/KnpMenu#119