Fix incorrect strftime error handling in rust_localtime
Closes #8702.
auto merge of #8913 : poiru/rust/issue-8702, r=cmr

Closes #8702.