Remember which vars are already defined and declare them as `extern`

This change is needed for the REPL* (which compiles each form into a
separate shared library) in order to be able to re-define a
'closed-over' variable and having the closure behave as expected.

Example:

    (def x 1)
    (defn get-x [] x)
    (assert (= (get-x) 1))
    (def x 2)
    (assert (= (get-x) 2))

(*) http://github.com/bertfrees/cljc.repl