Fixes a write header bug in func JSONFail

Fixes an issue where c.JSONFail was attempting to write the headers multiple times