Will PostgreSQL optimize query when the same aggregate usage?
The reason you can't use the aliases is that they don't exist during aggregation, renaming is performed after aggregation. I don't know the answer to your question, I guess the only way to find out for sure is to look at the plan. However, have you considered nesting your query?

SELECT employe, s, d, s-d as total
FROM (
    SELECT employe, sum(salary + bonus) AS s
         , sum(debt) AS d,
    FROM test_table
    GROUP BY employe
) as t;


another option is to use a CTE:

WITH t as ( 
    SELECT employe, sum(salary + bonus) AS s
         , sum(debt) AS d,
    FROM test_table
    GROUP BY employe
)
SELECT employe, s, d, s-d as total
FROM t;