You spend a lot of time parsing these strings and doing the error-handling. I think it'd be better if we implement a new function for this:

```c
long global_option_get_long (char const *option_name, long default_value);
```

Then almost all of the below becomes:

```c
long high_limit = global_option_get_long ("WriteQueueLengthLimitHigh", 0);
long low_limit = global_option_get_long ("WriteQueueLengthLimitLow", (high_limit + 1) / 2);
```