Ringgit extends rally against US dollar to close firmer