Minor bug fix and add new sys variables

New variables in `sys`:

* based on `workdir`: `inputdir`, `libdir`, `masterdir`, `bindir`
* locate update and failsafe policies: `update` and `failsafe`

`libdir` is particularly convenient.

The bug fix is very minor and unlikely to matter either way, but it's tidier this way.