How do I return JSON structured as the transpose of json_agg() in PostgreSQL?
This will take care of the f1,f2,f3 name issue, but unfortunately can't think of an easy way for an arbitrary query.

 SELECT row_to_json(r) from 
      (SELECT array_to_json(array_agg(count)) As count, 
              array_to_json(array_agg(lead_source)) As lead_source
      FROM (
        SELECT count(lead_source), lead_source from leads_table group by lead_source    
          ORDER BY count desc
    ) as a) AS r;


This one is not quite as short but will allow you to to put an arbitrary in your a subquery and output the columns. (so solving both issue 1 and issue 2).  It piggy backs on hstore so if you don't have hstore installed, you'll need to do a:
    CREATE EXTENSION hstore;

SELECT  ('{' || string_agg(sv, ',') || '}')::json
 FROM (SELECT ('"' || (kv).key || '"' || ':' 
   || array_to_json(array_agg((kv).value) ) )   As sv
FROM (SELECT each(hstore(a)) As kv from 
  (
   SELECT count(lead_source), lead_source from leads_table group by lead_source    
      ORDER BY count desc
   ) as a) As r
 GROUP By (kv).key) As r2;