Fixes NullPointerException on invalid sessions

The destroySession method was called with null. Maybe this fixes #204. Could you please cherry pick the commit in all branches that are currently supported.

Regards.