msi: Properly map script function return values to MSI errors.