BaseTools: Fix corner-cases of --hash feature