A building society branch manager who falsified accounts from a branch in Oswestry in order to steal more than £40,000 to feed his gambling habit has been spared jail.