added defer example

decided not to use file i/o as an example because external file access
is rare in other tutorials.