Fix garbled dates when using --date-format
Fix garbled dates when using --date-format

Capture the `std::string` value from options in a local variable that
lives as long as the `c_str()` taken from it to ensure it does not get
freed prematurely.

Fixes: #546

ledger/ledger,ledger/ledger,afh/ledger,ledger/ledger,afh/ledger,afh/ledger,ledger/ledger,afh/ledger,ledger/ledger,afh/ledger