Avoid throwing an exception when passed null or undefined

Currently, the `parse` function throws an exception if `str` isn't a string, e.g. if it's not defined. It is entirely possible for `headers.cookie` to be undefined on an incoming HTTP request, but it seems reasonable to still execute `cookie.parse(request.headers.cookie)`. This PR makes the module respond gracefully.