People are stockpiling food and supplies in anticipation of violence after the closest presidential race since the end of military rule.