sh: Make parseredir() a proper function instead of an emulated nested
function.