Fix incorrect strftime error handling in rust_localtime

Closes #8702.