There was a stale lock file in the mailbox directory. This is a bug though. Asterisk should clean up all lock files on startup. Lastly, I can't explain the intermittent crash and wasn't able to catch it using gdb either.