Australia's share market has narrowed an early loss to end the session lower, after commodity prices bolstered energy stocks and miners.