Optimization of Mg-based fiber optic hydrogen detectors by alloying the catalyst