Shares up 7% as return to profit is accompanied by news it will trim global workforce by 17%