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
Merge "Ensure that 404's are returned as JSON"