Fixed obsolete null-test

The changed line of code was based on the old system with clanlib callbacks which no longer exist. Now as `std::function` is used, the `is_null` method is no longer applicable. I replaced it with the boolean operator of `std::function`.

As I use the event dispatcher in my current project I also could test this and it works.

I also added the `<map>` header as I got errors if I include the global `network.h` without including this header anywhere in my project.