Ensure that 404's are returned as JSON

Overide default Pecan 404 behaviour, and return a error from middleware
like all other errors

Change-Id: Idd2a051f5ce298f7cc5327ceb2946cfc30fe68ac
Closes-Bug: #1333347
(cherry picked from commit 047f94c17859fe424e936c7255812adc372ea9e7)