Catch first keyboard interrupt and make sure that log file gets closed and plot gets made (based on change by @saimn)
Merge pull request #13 from astrofrog/interrupt

Catch first keyboard interrupt