Shadow chancellor’s vow designed to show fiscal responsibility of opposition party ahead of next general election