[bugfix] Fixes errorneous usage of shared_ptr.

Previously, there was assignmet of shared_ptr from a nullptr which failed
to compile with for gcc-4.4. I guess this is in accordance with the standard
as assigning from a regular pointer seems faulty, too. Therfore we now use
shared_ptr::reset() to unset a shared_ptr. Additional we resort to using the
empty constructor for constructing empty shared_ptr, which reads better.

Fixes flyspray issue 1459, see
https://dune-project.org/flyspray/index.php?do=details&task_id=1459