Wrap C FILE handle in shared_ptr to provide exception safety.

Closes #9