Build fixes for JNI on Mavericks (from simoncn)