Provide a new class template `attempt`

The new class encapsulates the result of a computation that may succeed or
fail. It is useful to encapsulate the result passed to callback functions.
Change the signature of async IO handlers

As reported in issue #27, the handler signature has been changed to admit
an `attempt` object rather than a tuple of Boost error code and amount of
bytes transferred.