core: use application:get_env/2 as application:get_env/3 is not available on R15
Issue #767

(cherry picked from commit 0846910054ac87b68560c7a64dddf66e093b0e6f)