Given a string s, return the index of the first character that appears exactly once. If no such character exists, return -1. Implement the solution in Python using an efficient approach based on character frequency counting.
def first_unique_char(s):