Three-body decays of heavy Dirac and Majorana fermions