Race condition: NPE when starting with no database

When starting a river on a non existing database, on extremely rare race conditions, it could happen that the river fails with a NPE due to that line:

```
Object seq = ctx.get("seq");
String id = ctx.get("id").toString();
```

`ctx.get("id")` could send back a Null value.

Closes #67.
(cherry picked from commit 0b2b46d)