Check C source dependencies in needs_compile

This makes rebar recompile/relink port drivers properly when only C headers change.

I tested this on Linux with gcc, I'm not sure whether this is portable.