Update behaviour for JSON error handling

As discussed previously by @phikai

When a variable is not found or you do not have access it throws an ERROR message in BOTH cases.

When using option --format json or -F json it should be formatted in JSON.

current STDIO output

glab variable get DUMMY 
          
   ERROR  
          
  404 Not Found.    

current JSON putput

glab variable get DUMMY -F json
          
   ERROR  
          
  404 Not Found.    

DESIRED JSON OUTPUT

[{"key":"ERROR",,"message":"404 Not Found."}]

Maybe check error handling on all commands when using --format json or -F json

Edited by Bart DevOps