Refactor the device registration task

Just made some small changes to the device registration task by making
use of the client controller as well and restructuring the onPostExecute
method.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>