sim: Fix heap memory corruption when parsing SIM_EVENT_READ_FILE