Make base::task::get_handle() callable only once

In order to provide move semantics of the result stored in the shared
state it must be assured that only one instance of the handle to the
task exists.