(no ticket) Fix {% check_perm %} when arguments raise exceptions

Change-Id: Ic079a5c6d99eae9a9b085780d2cb0e296beba3e9