I agree with Tom, outlawing @@trancount is lunacy. But you can use this instead:
IF xact_state() <> 0 ROLLBACK TRANSACTION
But do not simply comment out @@trancount. You cannot do a ROLLBACK without checking for an open transaction. That transaction may already have been rolled back by an inner scope when you arrive in the CATCH handler.